nandorojo/moti

[Types] @types/react 18.0.0 causes children type issue in AnimatePresence

Closed this issue · 7 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I believe there were some changes made to children type in the new react types package that causes following typescript error in AnimatePresence component (I think it needs to explicitly define children now?)

Type '{ children: false | Element | undefined; }' has no properties in common with type 'IntrinsicAttributes & AnimatePresenceProps'.

Expected Behavior

Should not error when children are passed

Steps To Reproduce

  1. Import AnimatePresence component
  2. Add some children to it
  3. Update to latest @types/react package

Versions

- Moti: 0.17.1
- Reanimated: 2.6.0
- React Native: 0.67.4

Screenshots

Screenshot 2022-04-09 at 10 44 48

Reproduction

this is a framer motion issue. i might have to update the dependency

can you run yarn why framer-motion and share the result?

Sure thing, here you go

framer-motion@3.10.6
node_modules/framer-motion
  framer-motion@"^3.9.1" from @motify/core@0.17.1
  node_modules/@motify/core
    @motify/core@"^0.17.1" from moti@0.17.1
    node_modules/moti
      moti@"0.17.1" from @skimitar/app@1.0.0
      @app
        @skimitar/app@1.0.0
        node_modules/@skimitar/app
          workspace @app from the root project
    @motify/core@"^0.17.1" from @motify/components@0.17.1
    node_modules/@motify/components
      @motify/components@"^0.17.1" from moti@0.17.1
      node_modules/moti
        moti@"0.17.1" from @skimitar/app@1.0.0
        @app
          @skimitar/app@1.0.0
          node_modules/@skimitar/app
            workspace @app from the root project

Looks like this was fixed upstream if moti updates framer-motion?
https://twitter.com/mattgperry/status/1513933956877627407

sounds good, until then you can use a yarn resolution for it. i’ll update when i get the chance. thanks for the catch!

Fixed in 0.18.0-alpha.17.

yarn add moti@canary