I'm very new to react so I'm just following youtube video but I got this error and I don't know anything about this. Terminal showing 'Compiled Successfully' but I'm getting this error. This is my App.js code
import Todos from './components/Todos';
import './App.css';
function App() {
React.state = {
todos: [
{
id: 1,
title: 'Pay the rent',
completed: false
},
{
id: 2,
title: 'Dinner at Pappu',
completed: false
},
{
id: 3,
title: 'CODROBO Meeting',
completed: false
}
]
};
return (
<div className='App'>
<Todos todos={this.state.todos} />
</div>
);
}
export default App;
and this is my Todos.js code
function Todos() {
return this.props.todos.map(todo => <h3> {todo.title} </h3>);
}
export default Todos;
According to video lecture browser must be showing all the todos but I'm getting this error
thisproperty, which is the property of class component. sothis.statewill throw error.