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

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

Asterisk AGI Python Script to Dialplan does not work -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -