Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (32 sloc) 1.09 KB

title: ReactJS: Css and JSX tags: reactjs

ReactJS uses JSX and that works different with CSS. Normally you can use a style string.

But with JSX you use a two curly-bracketed javascript property list then the css name and value are the properties. Dashes are replaced by camal case:

    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <div id="root"></div>
  <script type="text/babel">

    class Hello extends React.Component {
      render() {
        return (
          <div style={{display: "flex", flexDirection: "row"}}>
            <div>Hello {}!</div>
            <button>on acid</button>

      <Hello name="Davey dave dave" />,