I'm guessing you're trying to export the ToDoItems component.
First change the name of your component accordingly so you can export/reuse it
// ToDoItems instead of KirclassToDoItemsextendsComponent{// rest of your code}
then check your render method, this is no the good syntax, you're defining a function inside your render method which you should avoid at all cost. And React cannot access the return statement hence the warning.
importReact,{Component}from'react';classToDoItemsextendsComponent{state={todos:[{id:1,text:'Take out the trash',},{id:2,text:'Grocery shopping',},{id:3,text:'Clean gecko tank',}]};render(){consttodoItems=this.state.todos;returntodoItems.map((todoItem,index)=>(<divkey={index}><labelclassName="form-check-label"><inputtype="checkbox"value={todoItem.text}/>
{todoItem.text}</label>
</div>
));}}exportdefaultToDoItems;
ToDo.js
importReact,{Component}from'react';importToDoItemsfrom'./ToDoItems';classToDoextendsComponent{render(){return(<form>{/* Note that ToDoItems here is a component */}<ToDoItems/></form>
);}}exportdefaultToDo;
I'm guessing you're trying to export the ToDoItems component.
First change the name of your component accordingly so you can export/reuse it
then check your render method, this is no the good syntax, you're defining a function inside your render method which you should avoid at all cost. And React cannot access the return statement hence the warning.
Your render method should be:
Full code:
ToDoItems.js
ToDo.js
What a great solution to my problem. Thanks a lot.