v4.1.0
Additions
- 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
- 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.
- 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.