JuanMa
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
content/docs/render-props.md
|
|
@ -41,7 +41,7 @@ class MouseTracker extends React.Component { |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<div style={{ height: '100%' }} onMouseMove={this.handleMouseMove}> |
|
|
|
<div style={{ height: '100vh' }} onMouseMove={this.handleMouseMove}> |
|
|
|
<h1>Move the mouse around!</h1> |
|
|
|
<p>The current mouse position is ({this.state.x}, {this.state.y})</p> |
|
|
|
</div> |
|
|
@ -74,7 +74,7 @@ class Mouse extends React.Component { |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<div style={{ height: '100%' }} onMouseMove={this.handleMouseMove}> |
|
|
|
<div style={{ height: '100vh' }} onMouseMove={this.handleMouseMove}> |
|
|
|
|
|
|
|
{/* ...but how do we render something other than a <p>? */} |
|
|
|
<p>The current mouse position is ({this.state.x}, {this.state.y})</p> |
|
|
@ -127,7 +127,7 @@ class MouseWithCat extends React.Component { |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<div style={{ height: '100%' }} onMouseMove={this.handleMouseMove}> |
|
|
|
<div style={{ height: '100vh' }} onMouseMove={this.handleMouseMove}> |
|
|
|
|
|
|
|
{/* |
|
|
|
We could just swap out the <p> for a <Cat> here ... but then |
|
|
@ -183,7 +183,7 @@ class Mouse extends React.Component { |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<div style={{ height: '100%' }} onMouseMove={this.handleMouseMove}> |
|
|
|
<div style={{ height: '100vh' }} onMouseMove={this.handleMouseMove}> |
|
|
|
|
|
|
|
{/* |
|
|
|
Instead of providing a static representation of what <Mouse> renders, |
|
|
|