Styleguidist not working correctly with ReactDOM.render()

  javascript, react-styleguidist, reactjs, webpack

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.

example:

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

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

result:

enter image description here

Source: Ask Javascript Questions

LEAVE A COMMENT