Day 58

in #code7 years ago

March 12th, 2018
Hello! Today at the React for Beginners by Wes Bos I learned about loading Data into state onClick.
We have to include the button with an onClick event function

<pre><code> <button onClick={}>Load Sample Fishes</button> <p dir="auto">Everything that gets passed in to a component is available on the props object in that component.<br /> We also have to get the props. <pre><code> loadSampleFishes = () => { this.setState({ fishes: sampleFishes }); }; <p dir="auto">Cheers!