no message

This commit is contained in:
chenxuan
2024-04-12 14:20:25 +08:00
parent 21cd0726f7
commit d6c55ea5ec
6 changed files with 10 additions and 7 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
*/
import React from "react";
import proxyHoc from "./components/proxyHoc";
import css from './index.module.css';
class App extends React.Component {
constructor() {
super();
@@ -15,7 +16,7 @@ class App extends React.Component {
}
render() {
return (
<div className="app1">
<div className={css.app1}>
<h2>当前组件state:{this.state.age}</h2>
<h2>props:{this.props.title}</h2>
<h2>props:{this.props.name}</h2>
+2 -1
View File
@@ -1,5 +1,6 @@
import React from "react";
import extendsHoc from './components/extends'
import css from './index.module.css';
class App extends React.Component {
constructor() {
super();
@@ -13,7 +14,7 @@ class App extends React.Component {
}
render() {
return (
<div className="app2">
<div className={css.app2}>
{/* <NoStatusComponents title="我是无状态子组件" sendParent={this.getValue.bind(this)} /> */}
<h1>{this.props.title}</h1>
<h1>{this.props.name}</h1>
@@ -10,10 +10,11 @@ export default function Hoc(WithComponent, title) {
render() {
return (
<React.Fragment>
<div>{this.name}</div>
<div>{this.state.age}</div>
<h1>{title}</h1>
<h3>{this.name}</h3>
<h3>{this.state.age}</h3>
<WithComponent
title={title}
title="title-呵呵呵呵呵呵呵呵!"
name="name-陈轩陈轩!"
></WithComponent>
</React.Fragment>
@@ -10,7 +10,7 @@ export default function Hoc(WithComponent, title) {
render() {
return (
<React.Fragment>
<h1>参数:{title}</h1>
<h1>{title}</h1>
<WithComponent
title="title-呵呵呵呵呵呵呵呵!"
name="name-陈轩陈轩!"
+1 -1
View File
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App1 from './App1';
import App2 from './App2';
import reportWebVitals from './reportWebVitals';