Open electic opened 6 years ago
@electic The only way i discovered is to use React.createElement(el,props,child). So for instance:
<ReactPaginate
breakClassName="page-item"
breakLabel={React.createElement('a', {className:'page-link'}, '...')}
pageClassName="page-item"
previousClassName="page-item"
nextClassName="page-item"
pageLinkClassName="page-link"
previousLinkClassName="page-link"
nextLinkClassName="page-link"
/>
Where child can be a inner text(as the example) or in turn another React created element...
Hope it'll be useful... Cheers
Yah this is what I was afraid of. Thanks for letting me know though!
How would I inject JSX into a parameter. As an example:
Here is my JSX code:
The breakLabel requires a node as a parameter. Here is how it would be if I wrote it in JSX:
Any help appreciated.