Styleguidist not working correctly with ReactDOM.render()

I am working on a website and I am considering using styleguidist as the solution for our documentation.

However, if I try to make documentation for components rendered with ReactDOM.render(), styleguidist ends up with "Compiled successfully!" but fails on page render. I even know why this is probably happening, but I can’t figure out any workaround, other than excluding those files. Any ideas?

note: We are using rendered components, because we need to render them into php templates.


import React from 'react';
import ReactDOM from 'react-dom';
import Component from "./Component.jsx";

ReactDOM.render(<Component />, document.getElementById('component'));


enter image description here

41 thoughts on “Styleguidist not working correctly with ReactDOM.render()”

Leave a Comment