v0.3.0
- Fix and update peer dependencies.
- Fixed issue that prevented the "playground" example working in Opera.
- New thing: enable setting the layout via a parent context.
Thanks to everyone that has took the time to file issues and provide feedback.
Set a layout using a parent context
A useful (but optional!) way of setting a form-level layout.
If you set a layout
prop on a parent component, child formsy-react-components
use a mixin method to inherit this 'master' layout attribute.
var React = require('react');
var Formsy = require('formsy-react');
var FRC = require('formsy-react-components');
var MyForm = React.createClass({
mixins: [FRC.ParentContextMixin],
render: function() {
return (
<Formsy.Form className={this.getLayoutClassName()}>
<FRC.Input
name="input1"
label="Input"
/>
</Formsy.Form>
);
}
});
React.render((
<div>
<MyForm layout="vertical" />
<MyForm layout="elementOnly" />
</div>
), document.getElementById('app'));