Skip to content

Commit 862b0e1

Browse files
committed
doc: highlight how/why option.cloneElement can be used
1 parent b4cdb61 commit 862b0e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ A basic example showing the can be viewed at [codesandbox.io](https://codesandbo
192192
193193
[![Edit](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/mj5py581oy)
194194
195+
> This option allows to pass down props without to need to create a function
196+
> within render which merges the parent and received props.
197+
195198
```js
196199
class CountSeconds extends React.Component {
197200
state = {
@@ -216,9 +219,9 @@ class CountSeconds extends React.Component {
216219

217220
const DisplayValue = ({prefix = '', value}) => `${prefix}${value}`
218221

219-
const App = () => (
222+
const App = ({prefix}) => (
220223
<CountSeconds>
221-
<DisplayValue prefix="Seconds: " />
224+
<DisplayValue prefix={prefix} />
222225
</CountSeconds>
223226
)
224227
```

0 commit comments

Comments
 (0)