![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
current-input
Advanced tools
Detect the current input (mouse or touch) and fix the sticky :hover bug on touch devices.
current-input-mouse
or current-input-touch
class to the body
indicating the current input type.:hover
bug on touch devices and allow you to work with 3 interactive states in CSS: hover, active, and touch active.current-input
is as easy as set it and forget it, and is compatible with all modern browsers. It will automatically add the current-input-mouse
or current-input-touch
class to the body
.Demo website — demo code in the /docs
folder
current-input
npm install --save current-input
And then import it in your app (it will run automatically on import).
import 'current-input';
index.html
:Alternatively you can add the script directly to your index.html
. The version that comes from the Unpkg CDN is minified and gziped with all dependencies included and will run automatically.
<script src="https://unpkg.com/current-input@2/dist/current-input.umd.production.js"></script>
current-input
current-input
will run automatically and will add the class current-input-mouse
or current-input-touch
to the body
. Use the appropriate CSS selectors to style elements based on the current input class.
Here is an example using CSS to style links such that it fixes the sticky hover problem on touch devices and provides a unique touch active state. See the demo website for a live version of this example (demo code in the /docs
folder).
/*
In this example, links will be:
- Black normally
- Green on hover
- Red on active
- Blue on touch active
*/
a {
color: black;
}
.current-input-mouse a:hover {
color: green;
}
.current-input-mouse a:active {
color: red;
}
/* the touch active state */
.current-input-touch a:active {
color: blue;
}
:hover
bugThe sticky :hover
bug on touch devices occurs when you tap something that has a :hover
state. The :hover
state sticks until you tap someplace else on the screen. The reason for this is back in the early days of mobile, the web relied heavily on hover menus, so on mobile you could tap to see the hover menu. Sites are generally no longer be built this way, so now the sticky hover feature has become a bug. current-input
fixes the problem by allowing you to style the :hover
state for mouse and touch inputs separately. Now you can only style the :hover
state when the current-input-mouse
class is present, and do nothing when the current-input-touch
class is present, which fixes this bug.
FAQs
Detect the current input (mouse or touch) and fix the sticky :hover bug on touch devices.
The npm package current-input receives a total of 2 weekly downloads. As such, current-input popularity was classified as not popular.
We found that current-input 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.