Skip to content
Advertisement

Tag: children

Passing data onClick from child component to another child component in React.JS

I’m trying to render the selected li (mapped in a child component) in an another child component. So you have the following structure (very simple): Parent Component (Parent.JS) ➥ First Child called Title.JS (that should render the title selected from the Second Child, which will contain the menu) ➥ Second Child called Menu.JS (which contains the menu) The exercise I’m

Loop through childNodes

I’m trying to loop through childNodes like this: However, it output Uncaught TypeError: undefined is not a function due to forEach function. I also try to use children instead of childNodes but nothing changed. Does anybody know what’s going on? Answer The variable children is a NodeList instance and NodeLists are not true Array and therefore they do not inherit

Advertisement