React 类组件 import React from "react"; export class App1 extends React.Component{ render(){ return ( <div>类组件</div> ) } } React 函数式组件 import React from "react"; export function App2(){ return ( <div>函数式组件</div> ) }