Skip to content
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

useRestyle's filterRestyleProps function throwing error #160

Closed
niranjannitesh opened this issue May 25, 2022 · 4 comments
Closed

useRestyle's filterRestyleProps function throwing error #160

niranjannitesh opened this issue May 25, 2022 · 4 comments

Comments

@niranjannitesh
Copy link

TypeError: undefined is not an object (evaluating 'omitPropertiesMap.variant')

I believe this line (https://github.com/Shopify/restyle/blob/master/src/hooks/useRestyle.ts#L17) should be

-  const props = omitPropertiesMap.variant
+  const props = omitPropertiesMap?.variant
@sampsonjoliver
Copy link
Contributor

Getting this as well for calling useRestyle with any style function created through createRestyleFunction.

@fortmarek
Copy link
Contributor

Could you provide reproduction steps? I'm surprised this happens since Typescript doesn't complain.

@mabc21
Copy link

mabc21 commented Oct 12, 2023

I encountered this error when using useRestyle. My problem was not really migrating to V2.
https://shopify.github.io/restyle/guides/migrating-to-v2/

OLD: const restyleFunctions = [spacing, border, backgroundColor];
NEW: const restyleFunctions = composeRestyleFunctions([spacing, border,backgroundColor]);

Hope this helps someone.

@niranjannitesh
Copy link
Author

closed this issue as I am not facing this issue anymore, seems like it was a migration issue from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants