Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change extension of React component #3

Merged
merged 1 commit into from
May 31, 2019
Merged

Change extension of React component #3

merged 1 commit into from
May 31, 2019

Conversation

martinbean
Copy link
Contributor

Changed the extension of the example React component from .js to .jsx (which will help IDEs and editors to highlight the JSX template).

Tested the change locally in a new Laravel project and it still compiles successfully with Mix.

@taylorotwell taylorotwell merged commit 07234e7 into laravel:master May 31, 2019
@mmollick
Copy link

I see this was already merged, but figured I'd add my $0.02 anyways.

Using the .jsx extension really just comes down to opinion. IDE and editors should support JSX inside .js files without any trouble.

The React team has recommended against using the .jsx extension for a while and discontinued using it for CRA.

@igorpan
Copy link

igorpan commented May 31, 2019

Yep, I think .jsx extension shouldn't be used at all. Full explanation by Dan here: airbnb/javascript#985 (comment)

By the amount of upvotes on that comment, I assume that it's also how most of react community feels

@martinbean
Copy link
Contributor Author

I’m sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants