Comments (24)
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.
@LucaDiba you need to use const [yourRef] = useAutoAnimate<HTMLDivElement>();
from auto-animate.
This should be fixed in the latest betas since we removed peerDependencies
all together
from auto-animate.
Same here: peerOptional react@"^16.8.0" from @formkit/[email protected]
from auto-animate.
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.
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.
+1
from auto-animate.
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.
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.
Should work fine as long as you can do an ESM import
from auto-animate.
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.
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.
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.
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.
Hey, I'm facing the same issue
from auto-animate.
It does work fine when you use --force
from auto-animate.
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.
works for me but I'm using pnpm
from auto-animate.
@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.
@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.
@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.
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.
Just wanted to note that this comment fixed this error for me. π
from auto-animate.
Better not to use autoAnimate use useRef instead resolves all issues
from auto-animate.
Related Issues (20)
- Memory Leak
- Bug when deleting element of the array in React 18
- Inconsistent jumping inside flex item HOT 1
- Not working HOT 4
- Vue Virtual Scroller
- Wrong arguments order in AutoAnimationPlugin declaration
- Animate across lists? Across all elements inside a `ul`?
- How should I use fixed centering layout? HOT 1
- Incorrect rounding of element sizes while animating HOT 2
- When the page is refreshed, the component has no animation.
- Vue useAutoAnimate not working with v-if
- does not provide an export named 'autoAnimate'
- Animation starting coords are buggy when the container has transitioned positions
- How to add auto-animate to custom components (NuxtUI) HOT 1
- Headless UI + Auto-Animate | Issue with auto-animate conflicting HOT 1
- nuxt3 3.10.3 does not provide an export named 'autoAnimate' HOT 1
- I added the element from the front but the animation still appears from the last one HOT 1
- React.Children.map issue HOT 1
- How to animate single element? HOT 3
- The compatibility of TR tags is a bit difficult to use, and the TR animation effect has become distorted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-animate.