newbreedofgeek / react-stepzilla

A React multi-step/wizard component for sequential data collection
https://newbreedofgeek.github.io/react-stepzilla/
ISC License
618 stars 176 forks source link

Possible to allow PropType "node" as well as string for backButtonText and nextButtonText? #72

Open gtwilliams03 opened 6 years ago

gtwilliams03 commented 6 years ago

It would be nice to allow PropType node as well as a string to allow the insertion of icons, etc., into the button contents (backButtonText and nextButtonText):

nextButtonText={<span><FontAwesome name='chevron-right' /></span>}

Right now it throws an error if anything is included except a string:

Failed prop type: Invalid prop 'backButtonText' of type 'object' supplied to 'StepZilla', expected 'string'.
zeel commented 6 years ago

@gtwilliams03 we can make validation of propTypes to be oneOfType([string, node]) in codebase. cc @newbreedofgeek

jermsam commented 5 years ago

Was this ever implemented?

zeel commented 5 years ago

If we do this change then we need to change prop name. It can't be backButtonText.

We can introduce new prop here backButtonNode and nextButtonNode. If these two are present then it will have more priority over text.

@jermsam @gtwilliams03 @newbreedofgeek any thoughts on this implementation? I can start with this approach.