Skip to content

v4.1.0

Compare
Choose a tag to compare
@mikaelbr mikaelbr released this 11 Nov 09:45
· 55 commits to master since this release

Additions

  1. Adds ability to add local decorator to component through component.withDecorator():
// Some third party libraries requires you to decorate the
// React class, not the created component. You can do that
// by creating a decorated component factory
var someDecorator = compose(Radium, function (Component) {
  var DecoratedComponent = doSomething(Component);
  return DecoratedComponent;
});
var Component = component.classDecorator(someDecorator, function (props) {
  // ... some implementation
});
React.render(<Component />, mountingPoint);

This can also be used as a partially applied function:

var decoratedComponent = component.classDecorator(someDecorator);
var Component = decoratedComponent(function (props) {
  // ... some implementation
});

Bugfixes

  1. Fixes Omniscient component factory input to handle being new-ed up from within React. Fixes some test issues and potential bugs with contexts. See #123 for more info.
  2. Fixes as Omniscient component factory disguises as a React class. This works around the fact that many third party libraries uses custom ways to use classes. For instance hot reloading. See #125 for more information.