0

In the md file, I don't want react-styleguidist to run a code block. I just want to show this code source. But now it occurs an error.

I don't want the code block(const dialog = Modal.show(config);...) to run with react-styleguidist. I just want it to run the ModalExample code block.

Basic Usage

  • Modal.show(config)
// close dialog
const dialog = Modal.show(config);
dialog.close()
import Button from '@ui/Button/Button'
import Dialog from './Dialog';

class ModalExample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {visible: false}
    }
...

Uncaught ReferenceError: Modal is not defined

Pei Li
  • 33
  • 1
  • 1
  • 6
  • Not an expert with styleguidist but I believe if it is on a .md file it should not execute it if your config is correct. And if it is any other js file which you have selected to pick up the code from, then you should write it as in a JSDoc format /* ... */ – Carlos Ruana Mar 27 '19 at 14:47
  • Thank you very much. I got the correct config from https://github.com/styleguidist/react-styleguidist/issues/1322#event-2319607971 – Pei Li May 05 '19 at 14:23

0 Answers0