no message
This commit is contained in:
@@ -15,7 +15,7 @@ class App extends React.Component {
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div className="app1">
|
||||
<h2>当前组件state:{this.state.age}</h2>
|
||||
<h2>props:{this.props.title}</h2>
|
||||
<h2>props:{this.props.name}</h2>
|
||||
|
||||
@@ -13,7 +13,7 @@ class App extends React.Component {
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div className="app2">
|
||||
{/* <NoStatusComponents title="我是无状态子组件" sendParent={this.getValue.bind(this)} /> */}
|
||||
<h1>{this.props.title}</h1>
|
||||
<h1>{this.props.name}</h1>
|
||||
|
||||
@@ -6,8 +6,11 @@ body {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
.app2,
|
||||
.app1{
|
||||
box-sizing:border-box;
|
||||
width: 500px;
|
||||
border: 1px solid red;
|
||||
padding: 24px;
|
||||
margin: 24px 0 24px 48px;
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
// import App from './App2';
|
||||
import App from './App1';
|
||||
import App1 from './App1';
|
||||
import App2 from './App2';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
<App1 />
|
||||
<App2 />
|
||||
</React.StrictMode>
|
||||
)
|
||||
reportWebVitals();
|
||||
|
||||
Reference in New Issue
Block a user