-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
v9 useTransition regressions #676
Comments
There seem to be regression/change of behavior with Sample: react-spring 8 - https://codesandbox.io/s/ly068v5x2q In both cases no animation is expected (correct as the key is always the same), however in v8 Is this intended change? Originally posted by @Kukkimonsuta in #642 (comment) |
Similar issue reported by @RafalFilipek on Twitter: |
I just hit this issue while using the v9 beta-9. Below is a fairly minimal example. In latest v8 the content will update after clicking the button. In v9 the content will not update because the I'm guessing its necessary to cache the items by key for when an item leaves, but I'm guessing that the cache doesn't get updated again after the first render. import React, {useState} from 'react'
import { useTransition, animated} from "react-spring";
function Test() {
const [items, setItems] = useState([{ id: 1, content: "some content" }]);
console.log(items[0].content); // changes after pressing button
const transitions = useTransition(items, (item) => item.id, {
enter: { opacity: 1 },
leave: { opacity: 0 },
initial: { opacity: 0 }
});
const updateContent = () => {
setItems([
{
id: 1,
content: "some content, with even more content than before"
}
]);
};
return (
<>
<button onClick={updateContent}>change content</button>
{transitions.map(({ item, key, props }) => (
<animated.div key={key} style={props}>
{item.content}
</animated.div>
))}
</>
);
}
|
I've found that changing from Nevertheless, I still can't upgrade to v9 because of other regressions. I might open issues for them. |
Now available in v9.0.0-rc.2 #985 |
noticed a useTransition regression, my modal close animation stopped working after upgrading (it's now opening with animation and closing instantly on v9)
https://github.com/devhubapp/devhub/blob/6aa24bb96658ce2541f69f9eccfc3d65826c726b/packages/components/src/components/modals/ModalRenderer.tsx#L130-L172
Originally posted by @brunolemos in #642 (comment)
The text was updated successfully, but these errors were encountered: