222. Class vs Functional App.js

변지영·2022년 6월 17일
0

\robofriends\src\App.js
I want to change this to 'class App extends React.Component()'

Make return in a render method

and then I got this. ['React' is not defined]

so I have to import react from react

and compile.

So I created a class component.
'class App extends React.Component()'
I make an app I want the power of "React.component" that I've installed in this React component.
React.Component automatically detects this render method.

import logo from './logo.svg';
import './App.css';
import React from 'react';

class App extends React.Component() {
  render(){

0개의 댓글