UNPKG

react-style-px-suffix-codemod

Version:

append px to shorthand values in style objects in react in prep for react 15 warning

18 lines (16 loc) 258 B
const style1 = { height: "10px" }; const style2 = { height: "20px" }; class Cool extends Component { render() { const showing = this.props.showing; return ( <div style={showing ? style1 : style2}> hello </div> ); } }