Skip to content

Instantly share code, notes, and snippets.

@anuragl94
Last active March 29, 2018 05:03
Show Gist options
  • Save anuragl94/af56ddbb01ea8521d766a66ac5474b3c to your computer and use it in GitHub Desktop.
Save anuragl94/af56ddbb01ea8521d766a66ac5474b3c to your computer and use it in GitHub Desktop.
Highlights of migrating React from v15.6.2 to v16.2.0

1. Hard requirements (can be polyfilled)

  1. Collection types Map and Set
  2. window.requestAnimationFrame function

2. Deprecations (no more notices)

  1. react-with-addons.js is removed
  2. React.createClass replaced with create-react-class
  3. React.PropTypes as prop-types replaced with prop-types

3. Breaking changes

  1. ReactDOM.render() call inside a lifecycle method will no longer work
  2. Shallow renderer no longer calls componentDidUpdate()
  3. Errors in the render and lifecycle methods now unmount the component tree. Error boundaries will be required

4. New beneficial features

  1. React portals: Render subtree on a DOM node outside Component context. Useful for rendering modals (CSS of parent Component will not be applicable to components rendered outside).
  2. Components can return arrays as children. Useful for Components that render list items
  3. React Fragments: Component can return multiple children (different from returning an array, as array items need keys)
  4. Stack Trace is now supported. With this plugin on development side, debugging should be easier.

Detailed changelog here

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