Quantcast
Channel: How to get rid of the "className" attribute in JSX? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Jonny Buchanan for How to get rid of the "className" attribute in JSX?

You could write a Babel plugin for it - e.g. babel-plugin-react-html-attrs allows you to use class and for attributes when working with JSX in React and changes them to the className and htmlFor...

View Article


Answer by Przemysław Zalewski for How to get rid of the "className" attribute...

You should consider using a simple Styled component for that case that handles all true boolean properties as class names and joins them as a string using classnames.class Styled extends...

View Article


Answer by Simonov Dmitry for How to get rid of the "className" attribute in JSX?

You can do it like this: class Div extends React.Component { render() { return (<div className={this.props.cl} > {this.props.children}</div> ); } }; export default Div;And use<Div...

View Article

How to get rid of the "className" attribute in JSX?

My JSX files are full of:<div className="...">...</div>For example:const Page = () => (<div className="Page"><div className="sideMenu"><Route path="/"...

View Article
Browsing latest articles
Browse All 4 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>