scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.65k stars 192 forks source link

styles not affected Need Help #70

Closed c0d3-ninja closed 6 years ago

c0d3-ninja commented 6 years ago
import React from "react";
import PropTypes from "prop-types";
require('codemirror/lib/codemirror.css');
require('codemirror/theme/material.css');
require('codemirror/theme/neat.css');
require('codemirror/mode/xml/xml.js');
require('codemirror/mode/javascript/javascript.js');

import {UnControlled as CodeMirror} from 'react-codemirror2';

export default class App extends React.Component {
  constructor(props) {
    super(props);
}

  render() {
    return(
      <CodeMirror
  value={"var a=10;"}
  options={{theme:"material",mode:"javascript"}}
/>
    )
  }
}

App.propTypes = {

};
App.defaultProps = {

};
App.docs = {
};

This is my code and this is my result

screenshot 253

why css are not downloading? is there any mistakes in my code? @scniro

scniro commented 6 years ago

@vimalchandhru Have you double checked your webpack css loader? I suspect you're not loading the style sheets correctly. Otherwise this looks fine.

scniro commented 6 years ago

@vimalchandhru closing for now as I suspect your development setup could be the culprit here and not the component itself. Please reopen if you are able to provide any additional detail.