// vvv--- shown to aide explanation // const Library = (props) => { // const books = [ // "The Adventures of Herlock Sholmes", // "The Life and Lessons of Manny Mole", // "My Brother's Book" // ]; const response = (books.indexOf(props.request) > -1) ? <p>We have that book!</p> : <p>Sorry, we don't have that book.</p> // vvv--- shown to aide explanation of props.request, don't include it // ReactDOM.render( // <Library // request={"The Adventures of Herlock Sholmes"} // />, // document.getElementById("root") // );
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter