Listing 6-39: App with Lifted State
import {useState} from 'react';
import InputForm from './InputForm';
import FilterSelect from './FilterSelect';
import RemindersList from './RemindersList';
function App(){
const [reminders,setReminders] = useState();
const [userInput,setUserInput] = useState();
const [selectedFilter,setSelectedFilter] = useState("all");
return(
<div>
<InputForm userInput={userInput}
setUserInput={setUserInput} />
<FilterSelect selectedFilter={selectedFilter}
setSelectedFilter={setSelectedFilter} />
<RemindersList reminders={reminders} />
</div>
);
}
export default App;
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.