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

fixes typing with @types/react@18 #67

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Conversation

agnlez
Copy link
Member

@agnlez agnlez commented Aug 5, 2022

Fixes some typing issues through:

  • update of react-query@3 to @tanstack/react-query@4
  • framer-motion@7
  • @artsy/[email protected]
  • bumps @react-aria and @react-stately libraries. Removes temporary @react-stately/slider resolution.

Most updates (but @fresnel) fix the children typing issue in React@18 by upgrading to latest versions.

There's an issue with @fresnel: the library doesn't specify the prop children in its provider when @types/react@18 is enabled so we need to wait for an update that changes this. Meanwhile, instead of dealing with weird typing on our end to fix the error, I think it's better to disable TS for that specific line, add a comment and wait for the solution coming from the library itself.

Please, run rm -rf node_modules && yarn for a fresh install and ensure types are correct running yarn check-types command.

@vercel
Copy link

vercel bot commented Aug 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
front-end-scaffold-docs ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 8:14AM (UTC)

@agnlez agnlez added the work-in-progress work in progress label Aug 8, 2022
@anamontiaga
Copy link
Contributor

Watching the fixes into Fresnel I remembered how responsive is done in HeCo and I found this hook interesting:
https://github.com/Vizzuality/heco-invest/blob/develop/frontend/hooks/use-breakpoint.ts

Its use seems simpler than the Fresnel denominators.
A use case: https://github.com/Vizzuality/heco-invest/blob/develop/frontend/containers/home/start-banner/component.tsx

@mbarrenechea
Copy link
Member

Watching the fixes into Fresnel I remembered how responsive is done in HeCo and I found this hook interesting: https://github.com/Vizzuality/heco-invest/blob/develop/frontend/hooks/use-breakpoint.ts

Its use seems simpler than the Fresnel denominators. A use case: https://github.com/Vizzuality/heco-invest/blob/develop/frontend/containers/home/start-banner/component.tsx

The main reason is that in nextjs we need a SSR way of dealing with media queries. Otherwise we will see a first render that doesn't match the final view in some cases. Like showing the full header before it transforms to a hamburger icon...
https://github.com/artsy/fresnel#server-side-rendering-ssr-usage

@mbarrenechea
Copy link
Member

image

artsy/fresnel#260

@mbarrenechea
Copy link
Member

It seems that they have a fix, they will show something next week. I think it's safe to merge this PR right now, but we need to add a reminder to check this in the following weeks

@mbarrenechea mbarrenechea merged commit e5e240a into main Aug 9, 2022
@mbarrenechea mbarrenechea deleted the fix/types-with-react@18 branch August 9, 2022 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants