filestack / filestack-react

Official React component for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
MIT License
166 stars 41 forks source link

Feature Request: Custom Designed button > Allow buttonText to accept JSX #44

Closed natenrb9 closed 6 years ago

natenrb9 commented 6 years ago

Feature Request: Custom Designed button > Allow buttonText to accept JSX

This actually works to do what I want, I am passing JSX for an icon and text, and it does render the button correctly (with some CSS help), but it would be nice if it didn't throw an error...looks like it is just a matter of changing the prop type to accept an ob<ReactFilestack apikey={apiKey} buttonText={<AddCircle className={${classes.addCircleIcon} ${classes.addCircleIconLibraryContent}} />Add Content to Library} buttonClass={${classes.addButton} ${classes.addButtonLibraryContent}} options={options} onSuccess={this.uploadSuccess}ject?

<ReactFilestack
   apikey={apiKey}
   buttonText={<span><AddCircle className={`${classes.addCircleIcon} ${classes.addCircleIconLibraryContent}`} />Add Content to Library</span>}
   buttonClass={`${classes.addButton} ${classes.addButtonLibraryContent}`}
   options={options}
   onSuccess={this.uploadSuccess}
/>

screen shot 2018-03-21 at 3 30 49 pm

samuxyz commented 6 years ago

@natenrb9 Sorry for the super late reply, would you mind creating a PR for this yourself?

natenrb9 commented 6 years ago

Just figured out I can use the Custom Render -> render prop for this, should have realized this before. Thanks.