4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Day 57

March 11th, 2018

Hello! Today at the React for Beginners course by Wes Bos I learned about state, a very important but alas first a bit difficult bit.

What is state? It is basically just an object that lives inside of a component that stores all of the data that that component( as well as some children) needs.

     createFish = (event) => 
	        const fish = {
	        name:	this.nameRef.value.value,   // we reference the value in the object
	      …
       }

      this.props.addFish(fish);   
	          // refresh the form
	         event.currentTarget.reset();

Updating just the data.
You can use data, and React will know where to update it. You need to set the initial empty state.
I definitely need to review this more.

Cheers!

0 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: