Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Button): onClick of inner button returns value of props.onClick.
This change makes Button implementation return the value of props.onClick in its own onClick function. Rationale for the change: in my own use case, I have some onClick function call fetch methods. These onClick methods return the promise returned by fetch. For normal application use, this does not do anything. In unit tests however, this allows the unit-test to trigger the click and await on the handling of the response before doing assertions (using fetch-mock...). After switching from react-bootstrap to reactstrap, those tests do not work anymore since this onClick implementation does not pass the promise along. This change is backwards compatible if you assume nobody relies on onClick returning undefined. Please let me know if I can improve this change in any way.
- Loading branch information