Giter VIP home page Giter VIP logo

Comments (24)

kasparsuvi1 avatar kasparsuvi1 commented on July 2, 2024 6

To only override '@formkit/auto-animate' react dependencie you can do:

 "overrides": {
    "@formkit/auto-animate": {
      "react": "17.0.2"
    }
  },

(Still not ideal solution, but doesn't require --force and can be removed with new beta version)

from auto-animate.

luke-ae avatar luke-ae commented on July 2, 2024 5

@LucaDiba you need to use const [yourRef] = useAutoAnimate<HTMLDivElement>();

from auto-animate.

justin-schroeder avatar justin-schroeder commented on July 2, 2024 4

This should be fixed in the latest betas since we removed peerDependencies all together

from auto-animate.

nadilas avatar nadilas commented on July 2, 2024 3

Same here: peerOptional react@"^16.8.0" from @formkit/[email protected]

from auto-animate.

justin-schroeder avatar justin-schroeder commented on July 2, 2024 2

yeah, all peer dependencies are being removed in beta.2 because it seems package managers dont do a great job of respecting the "optional" property. Mia culpa on that.

from auto-animate.

one2code avatar one2code commented on July 2, 2024 2

Same problem. Was really excited to take this package out for a spin after seeing Theo use it, but then I got slapped with this:

npm ERR! While resolving: @formkit/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! peerOptional react@"^16.8.0 || ^17.0.0 || ^18.0.0" from @apollo/[email protected] npm ERR! node_modules/@apollo/client npm ERR! @apollo/client@"^3.6.9" from the root project npm ERR! peer react@"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" from @react-aria/[email protected] npm ERR! node_modules/@react-aria/ssr npm ERR! @react-aria/ssr@"^3.2.0" from @restart/[email protected] npm ERR! node_modules/@restart/ui npm ERR! @restart/ui@"^1.2.0" from [email protected] npm ERR! node_modules/react-bootstrap npm ERR! react-bootstrap@"^2.4.0" from the root project npm ERR! 11 more (@restart/hooks, @restart/ui, prop-types-extra, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution

Hopefully soon.

from auto-animate.

canerd7u avatar canerd7u commented on July 2, 2024 1

+1

from auto-animate.

LucaDiba avatar LucaDiba commented on July 2, 2024 1

all peer dependencies are being removed in beta.2

I've just tried to install the package by ignoring the dependencies, however it seems that there are some TypeScript issues that have to be fixed, so I'm not sure whether making the dependencies optional would solve the issue @justin-schroeder.
Or maybe this is not related to the dependencies?

(property) ClassAttributes<HTMLDivElement>.ref?: LegacyRef<HTMLDivElement> | undefined
Type 'RefObject<Element>' is not assignable to type 'LegacyRef<HTMLDivElement> | undefined'.
  Type 'RefObject<Element>' is not assignable to type 'RefObject<HTMLDivElement>'.
    Type 'Element' is missing the following properties from type 'HTMLDivElement': align, accessKey, accessKeyLabel, autocapitalize, and 114 more.ts(2322)
index.d.ts(137, 9): The expected type comes from property 'ref' which is declared here on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'

from auto-animate.

perfectbase avatar perfectbase commented on July 2, 2024 1

as a workaround for now, I added the following to my package.json

  "overrides": {
    "react": "18.2.0"
  }

It's working for me... but I would prefer not to have to use this.

from auto-animate.

justin-schroeder avatar justin-schroeder commented on July 2, 2024

Should work fine as long as you can do an ESM import

from auto-animate.

luke-ae avatar luke-ae commented on July 2, 2024

Not working for me either, error i'm getting:

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @formkit/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^16 || ^17 || ^18" from @headlessui/[email protected] npm ERR! node_modules/@headlessui/react npm ERR! @headlessui/react@"^1.6.5" from the root project npm ERR! peer react@"^17.0.2 || ^18" from @mux/[email protected] npm ERR! node_modules/@mux/mux-player-react npm ERR! @mux/mux-player-react@"^0.1.0-beta.21" from the root project npm ERR! 11 more (@trpc/next, @trpc/react, next, next-auth, react-dom, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /Users/lukemacauley/.npm/eresolve-report.txt for a full report.

from auto-animate.

Lukrisum avatar Lukrisum commented on July 2, 2024

Same here (using pnpm) :

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
└─┬ @formkit/auto-animate
  └── βœ• unmet peer react@^16.8.0: found 18.2.0

from auto-animate.

AndreyYolkin avatar AndreyYolkin commented on July 2, 2024

Same here: peerOptional react@"^16.8.0" from @formkit/[email protected]

I have the same conflict, but with vue. I think we all need to wait until beta 2, because 029b1a6 solves this problem

from auto-animate.

nadilas avatar nadilas commented on July 2, 2024

You could have stopped at package managers don’t do a great job. πŸ˜‚ no need to specify.

when is beta 2 expected to drop?

from auto-animate.

nawed2611 avatar nawed2611 commented on July 2, 2024

Hey, I'm facing the same issue

from auto-animate.

luke-ae avatar luke-ae commented on July 2, 2024

It does work fine when you use --force

from auto-animate.

AndreyYolkin avatar AndreyYolkin commented on July 2, 2024

I don't want to use --force, which can possibly broke other dependency resolutions, that's why I temporarily removed lib from project

from auto-animate.

kristian-puccio avatar kristian-puccio commented on July 2, 2024

works for me but I'm using pnpm

from auto-animate.

LucaDiba avatar LucaDiba commented on July 2, 2024

@LucaDiba you need to use const [yourRef] = useAutoAnimate<HTMLDivElement>();

Thanks @luke-ae!
Is there a reason why we should specify the generics?
Also, all the examples use auto animate in a div but do not specify the type: is there something different in my case? Should the docs be updated or this is kinda a bug and will be fixed in the future?

from auto-animate.

luke-ae avatar luke-ae commented on July 2, 2024

@LucaDiba not 100% sure but you're getting a typescript error telling you that you need to add that in. I don't think it matters if it's a div or not.

from auto-animate.

perfectbase avatar perfectbase commented on July 2, 2024

@LucaDiba
The examples in the docs are in JavaScript.
If you are using TypeScript, the ref needs to be of the right type for you to set it in an element.
The generic is used internally to cast the ref type.

(I do think it's important to have typescript examples in the docs, though)

from auto-animate.

savin2001 avatar savin2001 commented on July 2, 2024

Not working for me either, error i'm getting:

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @formkit/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^16 || ^17 || ^18" from @headlessui/[email protected] npm ERR! node_modules/@headlessui/react npm ERR! @headlessui/react@"^1.6.5" from the root project npm ERR! peer react@"^17.0.2 || ^18" from @mux/[email protected] npm ERR! node_modules/@mux/mux-player-react npm ERR! @mux/mux-player-react@"^0.1.0-beta.21" from the root project npm ERR! 11 more (@trpc/next, @trpc/react, next, next-auth, react-dom, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peerOptional react@"^16.8.0" from @formkit/[email protected] npm ERR! node_modules/@formkit/auto-animate npm ERR! @formkit/auto-animate@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /Users/lukemacauley/.npm/eresolve-report.txt for a full report.

Same here too

from auto-animate.

LinnJS avatar LinnJS commented on July 2, 2024

Just wanted to note that this comment fixed this error for me. πŸ™‚

from auto-animate.

mohanbishnoi avatar mohanbishnoi commented on July 2, 2024

Better not to use autoAnimate use useRef instead resolves all issues

from auto-animate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.