Listing 4-29: Making use of props in a child component
function NavItem(props){
return (
<button onClick={props.onClick}>Click Me</button>
)
}
export default NavItem;
Download the examples, report issues, and ask/answer questions in the discussion area by visiting the book's github page. All of the code for the book is also available on codesandbox.io for you to play around with.
ReactJS Foundations is published by John Wiley and Sons, Inc and is available in paperback and eBook.