-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
registerPage: No converter for component of type "function ConnectFunction(props) {... #82
Comments
I'm confused. Every React component (I'm aware of) must be a function (either a class component or a FC). Can you show the MWE? I tried, e.g., a class component and everything works without a flaw. Just to be clear - if your code ends up in this part, you'd put in an object (as in |
Here you go: https://github.com/SantoJambit/piral-mwe |
I've taken a deeper look and I think the issue comes with React.memo. I've updated the MWE to use React.memo instead of react-redux to reproduce the issue. |
Other react higher order components return objects as well: React.lazy, react.forwardRef. The common part seems to be that an attribute $$typeof is present, with a value of |
I see, thanks for figuring out a way to reproduce this. I think we can deal with the According to the type definitions we have: interface ExoticComponent<P = {}> {
/**
* **NOTE**: Exotic components are not callable.
*/
(props: P): (ReactElement|null);
readonly $$typeof: symbol;
} So looking if Hotfix with 0.8.1 incoming later today / tomorrow morning. Thanks for the report! 🍻 |
Landed in |
Bug Report
Prerequisites
Environment Details and Version
Piral 0.8.0
Description
calling registerPage with a component returned by react-redux's
connect()
method, I'm getting an exception:No converter for component of type "function ConnectFunction(props) {...
Steps to Reproduce
app.registerPage()
Expected behavior
I expect this to work with react-redux components.
Actual behavior
An exception is thrown
Possible Origin
At this point, you are trying to use component.type:
piral/src/packages/piral-core/src/utils/components.ts
Line 16 in 57dd5af
But component.type is not a string, but instead is a function for this connected component.
The text was updated successfully, but these errors were encountered: