question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to install jsx

See original GitHub issue

I have seen an example online that use language-jsx nicely. I have also found this PR #479.

However, I don’t have any coloration for my jsx. Is jsx supposed to work out of the box?

edit

On the list on the site there is also json, but json work only with js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

23reactions
kopaxcommented, Apr 17, 2020

Solved by importing :

import PrismJsx from 'prismjs/components/prism-jsx.min';

Edit

That does always work on recent build environment because of the non existing default PrismJsx imported.

In this case you can use require('prismjs/components/prism-jsx.min') instead of es6 import synthax.

1reaction
rayanoncybercommented, May 12, 2020

Hey!

Installing works perfectly but none of the JSX is displayed, only the JS.

Anybody else have that problem? I’ve installed the right languages on top of my .babelrc config.

Thank you!

Screenshot 2020-05-12 at 00 11 11
Read more comments on GitHub >

github_iconTop Results From Across the Web

jsx - npm
Start using jsx in your project by running `npm i jsx`. There are 25 other projects in the npm registry using jsx.
Read more >
jsx | Yarn - Package Manager
INSTALLATION. The JSX compiler toolkit is released as a npm package, so you can install it with npm install -g jsx . https ......
Read more >
Introducing JSX - React
It is called JSX, and it is a syntax extension to JavaScript. We recommend using it with React to describe what the UI...
Read more >
ReactJS - Environment Setup - Tutorialspoint
After successfully installing NodeJS, we can start installing React upon it using npm. You can install ReactJS in two ways ... Step 8...
Read more >
How to Install React.js with create-react-app - freeCodeCamp
The installation process may take a few minutes. After it is done, you should see a folder that appears in your workspace with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found