Skip to content

Implementing and refactoring the official React tic-tac-toe getting started tutorial

Notifications You must be signed in to change notification settings

liranfar/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro To React: Tic Tac Toe Official Tutorial

My components refactoring of Reactjs official tic-tac-toe tutorial

Components Scheme

scheme

Important notes

  • Data flow

    When you want to aggregate data from multiple children or to have two child components communicate with each other, move the state upwards so that it lives in the parent component. The parent can then pass the state back down to the children via props, so that the child components are always in sync with each other and with the parent.

  • Immutability

  • Keys

    When you render a list of items, React always stores some info about each item in the list. If you render a component that has state, that state needs to be stored – and regardless of how you implement your components, React stores a reference to the backing native views.

    When you update that list, React needs to determine what has changed. You could’ve added, removed, rearranged, or updated items in the list.

    It’s strongly recommended that you assign proper keys whenever you build dynamic lists. If you don’t have an appropriate key handy, you may want to consider restructuring your data so that you do.

    Explicitly passing key={i} silences the warning but has the same problem so isn’t recommended in most cases.

About

Implementing and refactoring the official React tic-tac-toe getting started tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published