![New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions](https://cdn.sanity.io/images/cgdhsj6q/production/86e6ebdea652d20da070ebbda20134b839972db7-1024x1024.webp?w=800&fit=max&auto=format)
Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
@rot1024/use-transition
Advanced tools
Readme
React Hooks for transition animation like Transition component in react-transition-group, but improves smooth transition
Transition component in react-transition-group, and use-transition are very nice. But they are incompatible with styled-components or Emotion, particularly with mountOnEnter
or unmountOnExit
.
In addition, react-transition-group and use-transition have incorrect transition duration when the transition direction is changed during the transition.
This library improves their problems. Following image is comparision of the libraries.
npm install --dev @rot1024/use-transition
# or
yarn add @rot1024/use-transition
import { useState } from "react";
import { styled } from "styled-components";
import useTransition from "@rot1024/use-transition";
const StyledDiv = styled.div`
transition: ${({ state }) => state === "entering" || state === "exiting" ? "all 1s ease" : ""};
opacity: ${({ state }) => state === "entering" || state === "entered" ? 1 : 0};
`;
const Component = () => {
const [isActive, setActive] = useState(false);
const state = useTransition(isActive, 1000, {
mountOnEnter: true,
unmountOnExit: true
});
// state is "entering", "entered", "exiting", "exited", or "unmounted"
const handleClick = useCallback(() => {
setActive(active => !active);
}, [isActive, setActive])
return (
<div>
<button onClick={handleClick}>Toggle</button>
{state === "unmounted" ? null : <StyledDiv state={state}>Transition</StyledDiv>}
</div>
);
};
MIT License
FAQs
React Hooks for transition animation like Transition component in react-transition-group
The npm package @rot1024/use-transition receives a total of 45 weekly downloads. As such, @rot1024/use-transition popularity was classified as not popular.
We found that @rot1024/use-transition demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.