babel-plugin-react-native-web-pass-classname

[react-native-web] Pass className property when style property is passed.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-react-native-web-pass-classname
100.2.14 years ago4 years agoMinified + gzip package size for babel-plugin-react-native-web-pass-classname in KB

Readme

babel-plugin-react-native-web-pass-classname
Pass className property whenever style is passed through.
It's useful when writing reusable components for react-native-web and when using react-native libs which were not optimized to also work for react-native-web.

Examples

Input:
const Foo = (props) =>
  <View
    style={[props.titleStyle, props.style]}
  />

Output:
const Foo = (props) =>
  <View
    style={[props.titleStyle, props.style]}
    className={props.className}
  />

License

MIT
(c) Decision Mapper - http://decisionmapper.com