days
-4
-5
hours
-1
-9
minutes
-4
0
seconds
-4
-8
search
JAX Developers Puzzle deadline approaching: Play for a chance to win a complimentary JAX London 2018 ticket!
Thumbs up!

JavaScript library React v0.13 released

JAX Editorial Team
Thumbs up image via Shutterstock

Facebook’s latest offering comes in the form of React v0.13, shipping about a week after the second release candidate. The JavaScript library sees some breaking changes this release, with the spotlight on ES6 class support.

The React Team over at Facebook has shipped React v0.13, bringing with it a changelog full of breaking changes and new features. The most important new feature comes in the form of support for ES2015-classes, to give developers more flexibility when writing new components.

Ben Alpert from React was optimistic about the team’s eventual goals for ES6 class support:

Our eventual goal is for ES6 classes to replace React.createClass completely, but until we have a replacement for current mixin use cases and support for class property initializers in the language, we don’t plan to deprecate React.createClass.

Some of the breaking changes that come up in v0.13 include the following:

  • Deprecated patterns that warned in 0.12 no longer work: most prominently, calling component classes without using JSX or React.createElement and using non-component functions with JSX or createElement
  • Mutating props after an element is created is deprecated and will cause warnings in development mode; future versions of React will incorporate performance optimizations assuming that props aren’t mutated
  • Static methods (defined in statics) are no longer autobound to the component class

A bunch of new top-level APIs have also been revealed, such as React.findDOMNode () and React.cloneElement (), as well as a new ref style, allowing a callback to be used in place of a name.

SEE ALSO: Facebook announces React Native

Alpert was on hand to interact with users after the news broke, who comments regularly on Hacker News as user spicyj. He had this to say in reply to a user’s curiosity about how mixins will work out in ES6:

Most cases of mixins (especially ones that involve state, as you allude to) can be implemented via composition by creating wrapper components instead. This is how Relay works and makes different components more contained and easier to reason about.

The full release announcement concerning React v0.13 is available here.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of