FormidableLabs / component-playground

A component for rendering React components with editable source and live preview
MIT License
1.19k stars 117 forks source link

Add props to configure CodeMirror #86

Open janmyler opened 7 years ago

janmyler commented 7 years ago

Enable passing configuration options for CodeMirror via props from <Playground /> while keeping the original defaults.

Adds: lineNumbers, smartIndent, lineWrapping, tabSize.

Intregrisist commented 5 years ago

I was just about to make a PR for this. I wonder if it might be better to make it an object prop:

<Playground
   editor={{
    lineNumbers: true
  }}
/>