DEV Community

savinder kour
savinder kour

Posted on

Hi everyone, I'm a beginner in React. I created a component,but its can't emport,can help enyone


Top comments (7)

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

import the ToDo component in your App component like this:

import ToDo from './Pages/ToDo.jsx`
Enter fullscreen mode Exit fullscreen mode

and use it on line #14 of App.jsx file like this:

<ToDo />
Enter fullscreen mode Exit fullscreen mode

PS: I would suggest you to always use lowercase folder names to avoid issues in your application. Instead of Pages, it should be pages

Collapse
 
savinder_kour_3b73c291978 profile image
savinder kour

thank u sir,m new , i dont know how dev community works, if i write something wrong ,sorry about that,

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

No issues. Learning something new always takes some time and practice. No worries. Happy to help.

Collapse
 
uzzy412_73 profile image
Alexandru Ene

We need some more details, if you can. What error do you see exactly? What can't you import?

Collapse
 
savinder_kour_3b73c291978 profile image
savinder kour

thank u sir,i faced lots of problem in react, when i any react folder,and when i open it again folder, its give error. and same folder cound't open in vs code which is open in cursor ai.

Collapse
 
uzzy412_73 profile image
Alexandru Ene

To me doesn't seem like a react problem at all. It has something to do with your code editor. I would suggest you to stick with one code editor. Open VS code, just double click on it from your desktop or where you keep it. Then File => Open Folder => Here select your project folder. Lastly, tell us, what errors are you talking about more exactly? What do you see?

Collapse
 
savinder_kour_3b73c291978 profile image
savinder kour



sir i got problem in routing , even when i try to import in main.jsx i cant even get suggestion , and got error,,,,, can u help me.