¿Por qué es tan difícil publicar aquí? Todo lo que escribo en el título no se acepta. Lo siento, no tiene sentido.
¡Hola a todos! estoy teniendo este error
Error: llamada de gancho no válida. Los ganchos solo se pueden llamar dentro del cuerpo de un componente de función. Esto podría suceder por una de las siguientes razones:
Esto solo parece suceder después de importar material-ui. Estoy bastante perplejo. Aquí está mi código.
import {Container, AppBar, Typography, Grow, Grid} from '@material-ui/core' import bandmate from './images/bandmate.jpeg' const App = ()=> { return ( <Container maxidth = 'lg'> <AppBar position = 'static' color = 'inherit'> <Typography varaint = "h2" align = 'center'>BandMate</Typography> <img src= {bandmate} alt = 'bandmate' height= '60'/> </AppBar> </Container> ); } export default App;Las soluciones con las que me he topado parecen hacer referencia al paquete web, no estoy usando el paquete web, así que no estoy seguro de adónde ir con eso. Seguí el enlace anterior y ejecuté este código según las instrucciones y devolvió falso, lo que significa que tengo un problema de reacción duplicado
window.React1 = require('react'); // Add this in your component file require('react-dom'); window.React2 = require('react'); console.log(window.React1 === window.React2);``` I've seen some people say to try npm link but I cant seem to get that to work either. I ran ```npm link ../myProjectName/client/node_modules/react``` Im not even sure if I am using npm link correctly, but I just get a ton of errors. All of the posts seem to point to this, but I either don't understand what I'm doing or its not the correct solution. Thank you all in advance for your help, I have been struggling with this for 2 days now with no progress. Also I'm not sure what is up with my formatting, I thought you open and close with ``` ``` but I guess not.Después de publicar esto, simplemente desinstalé todos mis paquetes, los reinstalé y solucioné el problema.