{
// with React it's very hard to manipulate deeply nested (grand child)
// component's properties.
// This is why you need to pass in a function that will accept an Object
(states) => {
// this function needs to return a single root component
return
// for simplicity this example does not defines states or transitions
// for these ReactF1 ui components however states.target1 does
// contain a variable called go and a function onComplete which
// will be the state in which this ui Component should be
// It should be Noted also that a Chief component can control other
// Chief's
;
}
}
```
#### Chief `states`
```javascript
var states = {
// this will define what state each of the ui components
// should be in during the out state
out: {
target1: 'out',
target2: 'out',
target3: 'out'
},
// this will define what state each of the ui components
// should be in during the idle state
idle: {
target1: 'idle',
target2: 'idle',
target3: 'idle'
}
};
```
#### Chief `transitions`
```javascript
var transitions = [
// this defines a path for Chief to go from out to idle
// if no animations are passed then all ui's states will
// be set at the same time.
//
// It should be noted you can also do this:
// { from: 'out', to: 'idle', bi: true }
// Which will create a bi-directional transition.
{ from: 'out', to: 'idle' },
// you may want to "stagger" ui going to a state
// this is how you'd do it
{ from: 'out', to: 'idle', animation: {
target2: {
delay: 0.25
},
target3: {
delay: 0.5
}
}
}
];
```
## License
MIT, see [LICENSE.md](http://github.com/Jam3/react-f1/blob/master/LICENSE.md) for details.