[1.7.0] useRestyle hook is not working anymore
See original GitHub issueAfter upgrading from v1.6.2, useRestyle stops working
Sample code:
const { style } = useRestyle([color], rest)
Above code is working on v1.6.2, but throw the error on v1.7.0
TypeError: undefined is not an object (evaluating 'omitPropertiesMap[key]')
I noticed that the composeRestyleFunctions is not imported into index.ts file
Related commits: https://github.com/Shopify/restyle/commit/cdf1520943c7e8af8762d0cae33e88c9760e60c6
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Layoutprops is not getting applied while using useRestyle hook
import React from 'react'; import { createVariant, createRestyleComponent, VariantProps, backgroundColor, BackgroundColorProps, useRestyle, spacing, ...
Read more >@shopify/restyle - npm Package Health Analysis | Snyk
Is @shopify/restyle safe to use? The npm package @shopify/restyle was scanned for known vulnerabilities and missing license, and no issues were found. Thus...
Read more >TypeError: (0 , _react.useEffect) is not a function - Stack Overflow
useState) is not a function in another file where I use React hooks. I want to solve the problem not implement a workaround....
Read more >Shopify restyle Issues - Giters
Create text variant defaults is not working. ... Type issues with restyle component props ... [1.7.0] useRestyle hook is not working anymore.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In order to fix it:
1/ I have to check omitPropertiesMap !== undefined due to the commit :https://github.com/Shopify/restyle/blob/b137e2f057a5b255c903c30e9721058dc7ec23d5/src/hooks/useRestyle.ts#L19 2/ also export composeRestyleFunctions into index.ts at root 3/ change
to
This should be fixed in
v2.0.0
, here’s a quick doc that describes the required migration changes: https://github.com/Shopify/restyle/blob/master/docs/MIGRATING_TO_V2.mdFeel free to reopen this issue if you find any related issue. We will unpublish v1.7.0 and v1.8.0 as they are minor bumps that contain breaking changes (or release v1.7.1 and v1.8.1 if we realise it’s too late to unpublish).