Day 58

in #code8 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

              <button onClick={}>Load Sample Fishes</button>

Everything that gets passed in to a component is available on the props object in that component.
We also have to get the props.

             loadSampleFishes = () => {
           this.setState({ fishes: sampleFishes });
       };

Cheers!

Coin Marketplace

STEEM 0.06
TRX 0.29
JST 0.049
BTC 70950.33
ETH 2073.95
USDT 1.00
SBD 0.47