4 ms·
You can use React without jsx by the way. The syntax isn't great but it is doable.
by beezlewax 1y ago
You can use React without jsx by the way. The syntax isn't great but it is doable.
- deleted 1y ago[deleted]
- actinium226 1y agoThis seems like something that's technically true but not very practical: https://react.dev/reference/react/createElement#creating-an-element-without-jsx https://react.dev/reference/react/createElement#creating-an-... It still doesn't solve the problem of scaling down to simple things. I think this is better illustrated with this codepen I made a while ago to implement a reactive button in React, Vue, Alpine, and vanilla JS: https://codepen.io/nbelakovski/pen/jEOVbyP https://codepen.io/nbelakovski/pen/jEOVbyP I tried to implement the React part without JSX, but I couldn't figure out how to render the function component, and while I was able to render a class component based on the old docs, I couldn't figure out how to use useState with it. But going back to the codepen, the React and the vanillaJS both look messy, but I would take the vanillaJS over React if it means that I can sprinkle a little JS in my code without having to buy the whole farm that is create-react-app + npm + eslint + vite + all the React stuff I've mentioned.