Closed devfreddy closed 4 years ago
The current prop list for <EmptyState> looks like:
<EmptyState>
heading: PropTypes.string, description: PropTypes.string, buttonText: PropTypes.string, buttonOnClick: PropTypes.func, buttonUrl: PropTypes.string, className: PropTypes.string, featuredImage: PropTypes.string, footer: PropTypes.func
More flexible options for customization. For example:
<EmptyState description={() => { return ( <React.Fragment> <p>Paragraph 1</p> <br/> <p>Paragraph 2</p> </React.fragment> ) }} </EmptyState>
Let's investigate and make a change to allow for any of them to be a function OR a string, like this:
heading: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), description: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), buttonText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), buttonOnClick: PropTypes.func, buttonUrl: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), className: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), featuredImage: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), footer: PropTypes.func
@devfreddy Do you have a use case in mind for providing a function to buttonUrl and className? Wouldn't we always want them to be a string?
buttonUrl
className
Closed by #74
Summary
The current prop list for
<EmptyState>
looks like:Desired Behavior
More flexible options for customization. For example:
Possible Solution
Let's investigate and make a change to allow for any of them to be a function OR a string, like this:
Additional context