I am making a 'Markdown Previewer' using ReactJS. However, I am stuck at a code that seems to me just fine. The error is simply of an 'unexpected identifier ='. Can't seem to wrap my head around as to why it displays this error.
Following is my code snippet ..
class Markdown extends React.Component {
static defaultProps = {
text : 'This comes from defaultProps !'
};
static propTypes = {
text : React.PropTypes.string.isRequired,
onChange : React.PropTypes.func.isRequired;
};
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
this.props.onChange(e.target.value);
}
render() {
const style = {
width : '100%',
fontSize : '18px',
border : '1px solid grey',
padding : '20px'
};
return (
<textarea style={style} rows='20' placeholder='// Enter text here ..' onChange='this.handleChange'>
{this.props.text}
</textarea>
);
}
}
Here is project code link .. https://codepen.io/iamrkcheers/pen/oeEyvo
The error occurs at line 67.
Any help is appreciated. Thank you.