javascript - React.jsx vs React.js as a filename extenison for component creation -
as part of react development, came across components part of jsx. saw script files created .jsx extension , again same concept of components used .js extension.
for rendering components, reactdom.render() same in both cases.
but script type .jsx <script src="text/jsx">
and .js <script src="text/babel">
as jsx acts syntactic sugar creating elements in form of components. , babel used transpiler covert component elemental form.
my question have criteria use either 1 of these @ particular instant of time?
in case, rule of thumb is:
- index.js js logic
- nameofcomponent.jsx render function
i explained in depth here: https://hackernoon.com/building-modular-interfaces-a4e4076b4307
and here boilerplate can use: https://github.com/metaphorical/quantum-blox
wiki
Comments
Post a Comment