<div className={"app-container"}> <div className="alertapp"> This is my app <br/> <button type={"button"} onClick={() => console.log('clicked')}> Log to console </button> <button type={"button"} onClick={toggleModal}> Frob </button> </div> {showAlert && <Alert onClose={toggleModal} onOK={handleAlertOK}> <div> Are you sure you want to Frob the blitzen? </div> </Alert>} </div>
Basically, the Alert component should handle the OK and Cancel buttons.
Hint: the children elements of the Alert tag (the div that includes "Are you sure you want to Frob the blitzen?") are available in the Alert render function as props.children.
Modify the Alert component so that you can optionally provide different text for the Cancel/OK buttons.
function TabApp() { return ( <TabList> <div key="Tab 1">Hello, world!</div> <div key="Tab 2">Goodbye, universe!</div> </TabList> ); }
Hints: