I'm trying to create a React tutorial on Github, but I'm having issues with getting the Github formatting to line up with what I want to display. I would like to display this code:
```JavaScript
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class Child extends Component {
render() {
return (
<p className="App-intro">
I'm a childish component
</p>
);
}
}
export default Child;
```
But on Github, it is appearing like this:
Is the single quote the problem? Is Github unable to rend React because of the JavaScript/HTML mix?
Use JSX for the language:
```JSX
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class Child extends Component {
render() {
return (
<p className="App-intro">
I'm a childish component
</p>
);
}
}
export default Child;
```
Should render correctly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With