React: passing props from child to parent
I've detailed my question on SOF for readability and clarity, appreciate any help!
https://stackoverflow.com/questions/76932958/passing-props-from-child-to-parent
Stack Overflow
Passing props from child to parent
I've got a side-nav.js which has the list of categories of items, I want to grab the categoryid and pass it to the parent layout.js, then to the parent of layout.js -> customer.js.
Currently I'm
6 Replies
what's the parent of layout.js ? where is
setSelectedCategory
coming fromthe parent of layout.js is customer, I'm not sure if i even need setselectedcategory
the error is simply saying that it's not a function but you're trying to call it like it is
props.setSelectedCategory(category.id)
yea usually i would just do props.category.id but that is giving me error as well
put your code in a codesandbox or something easier to help then
do i need to send in my backend as well?
https://codesandbox.io/p/github/Fennzo/IncedoFront/master?workspaceId=2cfdb890-0378-4eb6-9f13-bd958dd39483