Skip to content

Commit c50d09b

Browse files
committed
chore
1 parent 6dbdfb9 commit c50d09b

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

README.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,38 @@ import render from 'react-render-callback'
115115
const render = require('react-render-callback')
116116
```
117117

118-
- `renderable` (optional): anything that can be rendered like a function, a component, or elements
119-
- uses [`React.createElement`][create-element]
120-
for react types like
121-
[class components](https://reactjs.org/docs/react-component.html),
122-
[context](https://reactjs.org/docs/context.html) provider or consumer,
123-
[forward refs](https://reactjs.org/docs/react-api.html#reactforwardref),
124-
[factories](https://reactjs.org/docs/react-api.html#createfactory), ...
125-
- invokes stateless function components (SFC) respecting their
126-
[`defaultProps`][default-props]
127-
- not using [`React.createElement`][create-element]
128-
for improved performance
129-
- except the SFC has [`propTypes`](typechecking-with-proptypes) and
130-
`process.env.NODE_ENV` is not `production`, in that case `React.createElement` is used to
131-
enable typechecking with [PropTypes][prop-types]
132-
- gracefully handles other types like string, array,
133-
[react elements][create-element], ...
134-
- `props` (optional): to pass to `renderable` (if renderable is a function or react element type)
135-
- `options` (optional):
136-
- `cloneElement` (default: `false`, since: v1.1.0): allows to pass props to
137-
the element using [`React.cloneElement`][clone-element]
138-
139-
140-
```js
141-
render(<a href="#bar">bar</a>, {title: 'foo'})
142-
// --> <a href="#bar">bar</a>
143-
144-
render(<a href="#bar">bar</a>, {title: 'foo'}, {cloneElement: true})
145-
// --> <a href="#bar" title="foo">bar</a>
146-
```
118+
**renderable** (optional): anything that can be rendered like a function, a component, or elements
119+
120+
- uses [`React.createElement`][create-element]
121+
for react types like
122+
[class components](https://reactjs.org/docs/react-component.html),
123+
[context](https://reactjs.org/docs/context.html) provider or consumer,
124+
[forward refs](https://reactjs.org/docs/react-api.html#reactforwardref),
125+
[factories](https://reactjs.org/docs/react-api.html#createfactory), ...
126+
- invokes stateless function components (SFC) respecting their
127+
[`defaultProps`][default-props]
128+
- not using [`React.createElement`][create-element]
129+
for improved performance
130+
- except the SFC has [`propTypes`](typechecking-with-proptypes) and
131+
`process.env.NODE_ENV` is not `production`, in that case `React.createElement` is used to
132+
enable typechecking with [PropTypes][prop-types]
133+
- gracefully handles other types like string, array,
134+
[react elements][create-element], ...
135+
136+
**props** (optional): to pass to `renderable` (if renderable is a function or react element type)
137+
138+
**options** (optional):
139+
140+
- `cloneElement` (default: `false`, since: v1.1.0): allows to pass props to
141+
the element using [`React.cloneElement`][clone-element]
142+
143+
```js
144+
render(<a href="#bar">bar</a>, {title: 'foo'})
145+
// --> <a href="#bar">bar</a>
146+
147+
render(<a href="#bar">bar</a>, {title: 'foo'}, {cloneElement: true})
148+
// --> <a href="#bar" title="foo">bar</a>
149+
```
147150

148151
**returns**
149152

TODO.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)