One thing to keep in mind is that JSX is not HTML β it just looks. This is important because the JSX transpiler (usually Babel these days) uses the JSX syntax and modifies it from this:
<div className="container"> <p>Testing!</p> </div>
like that:
React.createElement("div", { className: "container" }, React.createElement("p", null, "Testing!") )
Distracted by calls to React.createElement , you can get a project like r-dom , which does the same, but with a stronger syntax:
r.div({className: 'container'}, [ rp('Testing!'), ])
or react-hyperscript , which allows you to use an alternative syntax for some properties:
h('div.container', [ h('p', 'Testing!') ])
However, since JSX turns into simple JS calls, any language or syntax that can be converted to React.createElement calls is great for React if you configured your Rails pipeline to properly translate as part of its serving assets.
There is a project that does this with a Jade syntax called jade reaction ; There are a few differences from regular Jade and some unsupported features , but it can do what you want it to do. In a Rails project, you will need to find or create a preprocessor that turns the corresponding Jade code into JS with specific requirements.
There is one more thing that I wanted to mention based on the comments in your question:
now i am writing bloated HTML again inside my components
If you're just talking about HTML syntax, then no problem, but if you find that the render methods of your React components are getting large and difficult to manage, then this is probably a good sign that you need to break your component into smaller components ( see βTip 4: Embrace Composition!β at this link) .