@@ -82,7 +82,7 @@ npm install --save react-render-callback
8282
8383### API
8484
85- ` render([ renderable [, props ] ]) ` :
85+ ` render([ renderable [, props [, options ] ] ]) ` :
8686
8787- ` renderable ` (optional): anything that can be rendered like a function, a component, or elements
8888 - invokes stateless function components (SFC) respecting their
@@ -101,6 +101,18 @@ npm install --save react-render-callback
101101 - gracefully handles other types like string, array,
102102 [ react elements] [ create-element ] , ...
103103- ` props ` (optional): to pass to ` renderable ` (if renderable is a function or react element type)
104+ - ` options ` (optional):
105+
106+ - ` cloneElement ` (optional, default: ` false ` ): allows to pass props to
107+ the element using [ ` React.cloneElement ` ] [ clone-element ]
108+
109+ ``` js
110+ render (< a href= " #bar" > bar< / a> , {title: ' foo' })
111+ // --> <a href="#bar">bar</a>
112+
113+ render (< a href= " #bar" > bar< / a> , {title: ' foo' }, {cloneElement: true })
114+ // --> <a href="#bar" title="foo">bar</a>
115+ ```
104116
105117** returns**
106118
224236[function -as-children]: https:// reactpatterns.com/#function-as-children
225237[react-component]: https:// reactjs.org/docs/react-component.html
226238[create-element]: https:// reactjs.org/docs/react-api.html#createelement
239+ [clone-element]: https:// reactjs.org/docs/react-api.html#cloneelement
227240[typechecking-with-proptypes]: https:// reactjs.org/docs/typechecking-with-proptypes.html
228241[prop-types]: https:// www.npmjs.com/package/prop-types
229242[react-is]: https:// www.npmjs.com/package/react-is
0 commit comments