Skip to content

Conversation

@devahmedsaleh
Copy link

No description provided.

@devahmedsaleh devahmedsaleh changed the title Add Default Value To Get Rid Of (undefined) In Case Of Async Data Loading. Add default value instead of (undefined) in case of async data loading. Sep 5, 2018
@isilher
Copy link
Collaborator

isilher commented Sep 11, 2018

Thank you for creating a PR @eng-ahmedsaleh!

For this particular addition however, I don't think it should be merged. The library expects value to always be set (it is a required param). Defaulting to a fallback (e.g. empty string) should be handled in the async logic that provides the value to the component.

If we would want to have a default fallback for value, it can be set in defaultProps instead of the componentDidMount method.

@isilher isilher closed this Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants