0
21
JRJose Romero
createreactcomponentβ’β’β’
React JavaScript RecipesThe export default class keyword tells React that this class represents the default template for a React component. When a user writes file.js and uses it as a component in their App.js file, React will automatically create a new file called filename.js and insert it into the source folder.
The filename class extends React's Component class, which means it implements all of the methods and properties of the Component class. The render method simply returns a <div> element.
Library: react
Shortcut: react.component.class.create
import React, { Component } from 'react'
export default class filename extends Component {
render() {
return <div></div>
}
}