Failing cases in JSX mode
See original GitHub issueFollowing up on: https://github.com/codemirror/CodeMirror/pull/3742
Three from the jsx/index.html page:
- Boolean attributes are not recognized properly (note the red self-closing
/>
) - Block comments styled incorrectly (should be the brown comment color)
- Line comments are not recognized properly (note the red self-closing
/>
)
Two other things I’ve found:
4 . Elements should be allowed as attributes
5 . Indentation in JS expressions should be relative to the indentation level of JSX elements. I believe currently they get indented to prior JS indentation level. (this issue is highest priority, if I had to choose)
Current behavior gif here:
Correct position here:
Another example of current behavior (not followed by } char):
Correct position here:
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (16 by maintainers)
Top Results From Across the Web
React automatic JSX fails with custom mode and externally set ...
The JSX transform doesn't seem to pick up NODE_ENV in this case, leading to importing JSX factory from jsx-dev-runtime , which is not ......
Read more >Error Boundaries - React
A class component becomes an error boundary if it defines either (or both) of the lifecycle methods static getDerivedStateFromError() or componentDidCatch() .
Read more >Setup - Testing Library
In these docs we'll demonstrate configuring Jest, but you should be able to do similar things with any testing framework (React Testing Library ......
Read more >How To Test Your React Apps With The React Testing Library
Both test cases are failing. Now let's add the component implementation to make them pass. Open src/TodoItem.js and update the code to the ......
Read more >How to Test React Components: the Complete Guide
The tests will pass if your hypothesis is correct and fail if it is wrong. Unlike your react components, your tests are not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t really understand why, if there’s already all this. I’m not saying the code should be physically copied, but enabling the Javascript syntax should IMO also enable JSX… especially if TypeScript and others are also already enabled.
If you select JavaScript mode, you get JavaScript, not TypeScript or JSX. These are different languages, they just happen to share a lot.