89missions / reactproblem

i have a react problem and not even chat gpt can help me . damn.
0 stars 0 forks source link

React problem #1

Open 89missions opened 2 days ago

89missions commented 2 days ago

So I have 3 pages , app.jsx and a folder which contains profile.jsx and edit profile.jsx . I'm passing a prop from app.jsx down to the other two, I am not using useContext hook. I'm just doing prop drilling . The problem is that , I'm trying to update a user name in edit profile.jsx using a state function from app.jsx . The error message is that , the function is not defined (the function which is passed as a prop) . Can anyone help me?

kavehmovahedi commented 1 day ago

Can you please provide more context? if it's the same as you have posted on Stack Overflow, it may be due to the naming. if you have named your state variable with a capital letter at the beginning like UserName react tries to render it as a component. Variables are supposed to have camel case names in react, only components have capitalized names.