Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Question ] Doesn't show up anything ( blank ), is my configuration wrong ? #59

Open
iroy2000 opened this issue Aug 15, 2016 · 2 comments

Comments

@iroy2000
Copy link

iroy2000 commented Aug 15, 2016

This is my first time using it and trying to setup a basic version in order for it to show up, the following is my setup, let me know if I did something wrong, thanks.

import React, { PropTypes } from 'react';
import { default as CodeMirror } from 'react-codemirror';
require('codemirror/mode/javascript/javascript');

const codeTypes = {
  javascript: 'var welcome = {\n\tmode: "javascript"\n};'
};

And the following is the render function

  render() {
    const props = this.props;
    const options = {
      lineNumbers: true,
      readOnly: false,
      mode: 'javascript'
    };

    return (
        <div>
          <CodeMirror
            ref="editor"
            value={props.code}
            onChange={this.updateCode}
            options={options}
            interact={this.interact}
          />
        </div>
    );
  }

And I do see the code generated, but my screen is blank, am I missing something ?

screen shot 2016-08-14 at 11 11 48 pm

@iroy2000 iroy2000 changed the title Doesn't show up anything ( blank ), is my configuration wrong ? [ Question ] Doesn't show up anything ( blank ), is my configuration wrong ? Aug 15, 2016
@kavun
Copy link

kavun commented Aug 18, 2016

You need to include the .css from

./node_modules/codemirror/lib/codemirror.css

@timmarinin
Copy link

Probably should be mentioned right in the README.md

NealEhardt pushed a commit to NealEhardt/react-codemirror that referenced this issue Sep 21, 2016
@NealEhardt NealEhardt mentioned this issue Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants