I was following a youtube tutorial about building an app in React JS.
https://www.youtube.com/watch?v=ngc9gnGgUdA
In that tutorial I created an App as described in it [time stamp: https://youtu.be/ngc9gnGgUdA?t=1993].
import React from 'react';
import {Container, AppBar, Typography, Grid, Grow} from '@material-ui/core';
import memories from './images/memories.png'
const App = ()=>{
return (
<Container maxidth='lg'>
<AppBar position='static' color="inherit">
<Typography variant='h2' align="center">Memories</Typography>
<img src={memories} alt='memories' height='60' />
</AppBar>
</Container>
);
}
export default App;
But I am getting this error,
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
I am beginner I may not have covered everything regarding problem statement, please ask if you require further information regarding my problem.
question from:
https://stackoverflow.com/questions/65640749/error-while-using-material-ui-within-react 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…