Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhaitao committed Jul 10, 2020
1 parent a14be3f commit f314556
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
Empty file added master
Empty file.
19 changes: 1 addition & 18 deletions src/components/State/Parent2/Child2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,7 @@ class Child2 extends Component {
// })
}
render() {
return <div className={'p2-child'}>
Child2 ClassComponent
<p>
<button onClick={this.add}>+</button>
{this.state.count}
</p>
<div className={'sub-child-wrapper'}>
<SubChild1/>
<SubChild2/>
</div>
{
this.state.domList.map(item => {
return <div key={item}>
item
</div>
})
}
</div>
return <h1 onClick={this.add}>{this.state.count}</h1>
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/State/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import Parent1 from './Parent1'
import Parent2 from './Parent2'
import Child2 from './Parent2/Child2'
import './index.css'
const State = () => {
return <div className={'state-component'}>
{/*<h2>State Change</h2>*/}
{/*<Parent1/>*/}
<Parent2/>
<Child2/>
</div>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,13 @@ export function discreteUpdates<A, B, C, D, R>(
c: C,
d: D,
): R {
/*
* fn: dispatchEvent
* a: 'click'
* b: 1
* c: App组件的原生DOM节点
* d: 事件对象
* */
const prevExecutionContext = executionContext;
executionContext |= DiscreteEventContext;
try {
Expand Down

0 comments on commit f314556

Please sign in to comment.