Skip to content

Commit 2879dd9

Browse files
committed
Use updated syntax in examples
1 parent 1c4b564 commit 2879dd9

24 files changed

+136
-53
lines changed

example/public/activation-click.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
<ReactCursorPosition
2222
activationInteractionMouse={INTERACTIONS.CLICK}
2323
>
24-
<PositionLabel />
25-
<InstructionsLabel />
24+
{(cursorProps) => (
25+
<div>
26+
<PositionLabel {...cursorProps} />
27+
<InstructionsLabel />
28+
</div>
29+
)}
2630
</ReactCursorPosition>
2731
);
2832
</code>

example/public/activation-hover.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323
hoverDelayInMs={250} //default: 0
2424
hoverOffDelayInMs={150} //default: 0
2525
&gt;
26-
&lt;PositionLabel /&gt;
27-
&lt;InstructionsLabel /&gt;
26+
{(cursorProps) => (
27+
&lt;div&gt;
28+
&lt;PositionLabel {...cursorProps} /&gt;
29+
&lt;InstructionsLabel /&gt;
30+
&lt;/div&gt;
31+
)}
2832
&lt;/ReactCursorPosition&gt;
2933
);
3034
</code>

example/public/activation-press.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@
2323
pressDurationInMs={500} //default
2424
pressMoveThreshold={5} //default
2525
&gt;
26-
&lt;PositionLabel /&gt;
27-
&lt;InstructionsLabel /&gt;
26+
{(cursorProps) => (
27+
&lt;div&gt;
28+
&lt;PositionLabel {...cursorProps} /&gt;
29+
&lt;InstructionsLabel /&gt;
30+
&lt;/div&gt;
31+
)}
2832
&lt;/ReactCursorPosition&gt;
2933
);
3034
</code>

example/public/activation-tap.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
&lt;ReactCursorPosition
2222
activationInteractionTouch={INTERACTIONS.TAP}
2323
&gt;
24-
&lt;PositionLabel /&gt;
25-
&lt;InstructionsLabel /&gt;
24+
{(cursorProps) => (
25+
&lt;div&gt;
26+
&lt;PositionLabel {...cursorProps} /&gt;
27+
&lt;InstructionsLabel /&gt;
28+
&lt;/div&gt;
29+
)}
2630
&lt;/ReactCursorPosition&gt;
2731
);
2832
</code>

example/public/activation-touch.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
&lt;ReactCursorPosition
2222
activationInteractionTouch={INTERACTIONS.TOUCH}
2323
&gt;
24-
&lt;PositionLabel /&gt;
25-
&lt;InstructionsLabel /&gt;
24+
{(cursorProps) => (
25+
&lt;div&gt;
26+
&lt;PositionLabel {...cursorProps} /&gt;
27+
&lt;InstructionsLabel /&gt;
28+
&lt;/div&gt;
29+
)}
2630
&lt;/ReactCursorPosition&gt;
2731
);
2832
</code>

example/public/class-name.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919

2020
export default () => (
2121
&lt;ReactCursorPosition className="example__target"&gt;
22-
&lt;PositionLabel /&gt;
23-
&lt;InstructionsLabel /&gt;
22+
{(cursorProps) => (
23+
&lt;div&gt;
24+
&lt;PositionLabel {...cursorProps} /&gt;
25+
&lt;InstructionsLabel /&gt;
26+
&lt;/div&gt;
27+
)}
2428
&lt;/ReactCursorPosition&gt;
2529
);
2630
</code>

example/public/on-activation-changed.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
this.setState({ isActive });
3535
}
3636
}}&gt;
37-
&lt;InstructionsLabel /&gt;
37+
{() => (
38+
&lt;InstructionsLabel /&gt;
39+
)}
3840
&lt;/ReactCursorPosition&gt;
3941
&lt;ActivationChangedLabel {...this.state} /&gt;
4042
&lt;/div&gt;

example/public/on-detected-environment-changed.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
this.setState({ detectedEnvironment });
3333
}
3434
}}&gt;
35-
&lt;InstructionsLabel /&gt;
35+
{() => (
36+
&lt;InstructionsLabel /&gt;
37+
)}
3638
&lt;/ReactCursorPosition&gt;
3739
&lt;DetectedEnvironmentChangeLabel {...this.state} /&gt;
3840
&lt;/div&gt;

example/public/on-position-changed.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
className: 'example__target',
3737
onPositionChanged: props =&gt; this.setState(props)
3838
}}&gt;
39-
&lt;InstructionsLabel /&gt;
39+
{() => (
40+
&lt;InstructionsLabel /&gt;
41+
)}
4042
&lt;/ReactCursorPosition&gt;
4143
&lt;PositionChangedLabel {...this.state} /&gt;
4244
&lt;/div&gt;

example/public/should-decorate-children.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@
3737
onPositionChanged: props => this.setState(props),
3838
shouldDecorateChildren: false
3939
}}&gt;
40-
&lt;PositionLabel /&gt;
41-
&lt;InstructionsLabel /&gt;
40+
{() => (
41+
&lt;div&gt;
42+
&lt;PositionLabel /&gt;
43+
&lt;InstructionsLabel /&gt;
44+
&lt;/div&gt;
45+
)}
4246
&lt;/ReactCursorPosition&gt;
4347
&lt;PositionLabel {...this.state} {...{
4448
className: 'example__external-label',

0 commit comments

Comments
 (0)