You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason this is a problem for us is because we're using shallow render in some test cases to only render a certain amount of levels of depth to verify that a correct component was mounted, but unfortunately the name is lost unless we explicitly set displayName on the connected component before exporting and rendering it.
I think that losing the original name of the component is to be expected, since connect returns a higher-order component. However, setting a displayName of "Wrapper" for every connected component doesn't seem great.
It's pretty easy to set the displayName of the Wrapper HOC to something more useful:
But this causes an integration test to fail since unistore now compiles to a file which is larger than the 750B threshold specified by the test, so I don't know if I should open a PR or not (or even if this is the preferred approach to solve the problem).
Activity
orzechowskid commentedon Jan 30, 2019
I think that losing the original name of the component is to be expected, since
connectreturns a higher-order component. However, setting a displayName of "Wrapper" for every connected component doesn't seem great.It's pretty easy to set the displayName of the Wrapper HOC to something more useful:
But this causes an integration test to fail since unistore now compiles to a file which is larger than the 750B threshold specified by the test, so I don't know if I should open a PR or not (or even if this is the preferred approach to solve the problem).