Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In connected components, export the base component (not connected), so that it can be tested without re-testing connect. This is possible, because in mapStateToProps, state is accessed via selectors, which can be tested separately. Also, in mapDispatchToProps, actions are defined by action creators that can also be tested separately. Some discussions on this matter: reduxjs/react-redux#325 (comment) reduxjs/redux#1534 https://jsramblings.com/2018/01/15/3-ways-to-test-mapStateToProps-and-mapDispatchToProps.html Ref #14
- Loading branch information
1 parent
b65f2ee
commit 654e76d
Showing
4 changed files
with
13 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters