Skip to content

Instantly share code, notes, and snippets.

@milkman4
Last active October 24, 2017 20:58
Show Gist options
  • Save milkman4/ec9f392970dc2523602db18f988ed24b to your computer and use it in GitHub Desktop.
Save milkman4/ec9f392970dc2523602db18f988ed24b to your computer and use it in GitHub Desktop.
Upgrading to React 16 - what's involved

Why React 16?

  1. Better Error Handling. Right now, we wrap all of our component lifecycle methods in a "TryCatch" which is very resource intensive. React 16 gives us a new lifecycle method called componentDidCatch, which will effectively handle it the same way, but in a much more efficient manner. Link to new Error Handling

  2. Better ways to render to dom elements not contained in component tree. Link To Info On "Portals". This is particularly useful for our "MapBubble" components

Things we need to do to upgrade to react 16 (could be more....):

  • change global Map to c3dMapInterface. Find and replace all "Map." calls to "c3dMapInterface"
  • remove hammerjs (depreciated), breaking in react 16
  • remove createclass/proptypes - set as React.CreateClass = 'react-create-class' etc
  • remove or rewrite react json table (depreciated), breaking in react 16
  • make sure the browsers support Map and Set es6 types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment