Closed timkindberg closed 7 years ago
@timkindberg Thanks for opening the issue and sorry for the delay. But unfortunatly this is impossible to do. The reason is that you are rewireing the connect method after it has been used. There are two possible solutions I would propose:
Hopefully one of this solutions may help.
Man that is quite disappointing but I understand the technical limitation. I was hoping somehow since it was a Babel transpile time thing that we could figure this out.
If I have the following code where I am importing something (in this case the
connect
function) and then using it at the top scope (not within a nested function scope):and I try to rewire it like so:
In the above test case the code still throws an error talking about missing a redux store; even though I rewired the
connect
method to be basically a pass through that returns the component identity. All the examples on the site do not cover this sort of use case but it's very common.Does rewire support this functionality?