D
D
Dubolom Unicellular2020-07-07 22:57:23
React
Dubolom Unicellular, 2020-07-07 22:57:23

When to use .js files and when .jsx? How do they differ from each other?

I noticed that some people use the .jsx extension to create react components.

How is it different from .js?

When does it apply?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Bohdan Petrov, 2020-07-07
@mindyourlifeguide

I use jsx when I have jsx markup.
If pure js, then js.
But I also know the approach when jsx is always used.

C
camelCaseVlad, 2020-07-08
@camelCaseVlad

There is no reason to follow this rule from Airbnb's lint.
Create a crite react app and you will see that .jsx files are not used there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question