Skip to content

Instantly share code, notes, and snippets.

@HenriqueLimas
Last active April 6, 2017 14:47
Show Gist options
  • Select an option

  • Save HenriqueLimas/72f7396d24d9e90bb26154e591b3dd16 to your computer and use it in GitHub Desktop.

Select an option

Save HenriqueLimas/72f7396d24d9e90bb26154e591b3dd16 to your computer and use it in GitHub Desktop.

Creating the Search Page Route

Try to never use HashRouter. On webpack use the property historyApiFallback: true and use BrowserRouter instead of HashRouter.

Loading JSON files

We need to add a loader on Webpack to say how it gonna manipulate json.

Iterating through data

We want to take an array and transform it in some other array, So we can use .map.

Best practics in React is best practics in JS.

Key property use it for performance reason and help React for that. Try to never use the index of the array..Instead, use an id or something that is unique.

Use forceUpdate only when you need. For example to use with third party libraries like jQuery or D3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment