Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make Prism js work with React

Because we love Prism but it does not work AS IS when in a React context.

import Prism from 'prismjs';

class MyComponents extends Component {
  componentDidMount() {
    Prism.highlightAll();
  }
  
  render() {
    // my content
  }
}
@jmau111

This comment has been minimized.

Copy link
Owner Author

jmau111 commented Apr 22, 2019

to fix some bugs while compiling mAAdhaTTah/babel-plugin-prismjs#4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.