Development component for connecting stateless components to an array of states
This should not be used in production
import React from 'react'
import { render } from 'react-dom'
import { pure } from 'react-pure-ui'
const Component = (props) => <h1>{props.children} fish</h1>
const states = [
{ children: 'one' },
{ children: 'two' },
{ children: 'red' },
{ children: 'blue' }
]
const PureComponent = pure('unique-key-for-component', states)(Component)
render(<PureComponent />, document.getElementById('root'))
Connects a stateless component to an array of possible states, allowing keyboard navigation through states with ← and →. Any props
passed in will be merged with the active state with the latter taking precedence.
Left Arrow
– navigate to the previous stateRight Arrow
– navigate to the next stateEscape
– turn off pure-ui state, passing through props rather than using states.
MIT