styletron-react-core
React bindings for Styletron, inspired by styled-components.
This package provides the core implementation that is agnostic of the shape style objects and the engine interface.
Installation
yarn add styletron-react-core
API
The styletron-react-core
package consists of the following named exports:
styled
Customizing createStyled
;
Returns a styled
function.
Params
opts
opts.getInitialStyle
: (void => Style
)opts.driver
: ((Style, Engine) => string
)opts.wrapper
: (StatelessFunctionalComponent<*> => StatelessFunctionalComponent<*>
)
Examples
; type customStyleT = $Shape< angle?: number velocity?: number>; interface CustomEngine string; : string { return engine;} : customStyleT { return {};} const wrapper = <div> <StyledComponent ...props /> </div>; const styled = ;