Skip to content
Snippets Groups Projects
Commit 4b7c28e3 authored by JYCHOI's avatar JYCHOI
Browse files

class component to arrow function

parent 25fb69df
Branches
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
const express = require('express');
const router = express.Router();
router.get('/', (req, res, next) => {
res.send('Hello, I am sample router');
});
module.exports = router;
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
class App extends Component { const App = () => {
render() {
return ( return (
<div> <h1>
Hello, React Boilerplate! What time is it?
</div> </h1>
); );
} }
}
export default App; export default App;
...@@ -2,6 +2,9 @@ import React from 'react'; ...@@ -2,6 +2,9 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import App from './App'; import App from './App';
ReactDOM.render(<App />, document.getElementById('root')); var container = document.getElementById('root');
var root = ReactDOM.createRoot(container);
root.render(<App />);
module.hot.accept() module.hot.accept()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment