New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-mkx-toolkit

Package Overview
Dependencies
Maintainers
0
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mkx-toolkit - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

useOnlineStatus/index.d.ts

2

package.json
{
"name": "react-mkx-toolkit",
"version": "1.8.1",
"version": "1.8.2",
"description": "React Custom Hooks provide an efficient means to encapsulate and share logic among components within React applications. This package includes useful React custom hooks.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -20,2 +20,3 @@ ## React Useful Custom Hooks

- [useNotification](#useNotification)
- [useOnlineStatus](#useOnlineStatus)
- [License](#license)

@@ -200,2 +201,32 @@ - [Author](#author)

## useOnlineStatus
The `useOnlineStatus` hook helps you track the browser’s online/offline status. It utilizes the navigator.onLine property and listens to the online and offline events to update the status in real time.
## Usage
```jsx
import React from "react";
import { useOnlineStatus } from "react-mkx-toolkit";
const MyComponent = () => {
const isOnline = useOnlineStatus();
return (
<div>
<h1>Network Status</h1>
<p>{isOnline ? "🟢 Online" : "🔴 Offline"}</p>
</div>
);
};
export default MyComponent;
```
### Features
- Automatically updates when the browser goes online or offline.
- Compatible with modern browsers and React versions.
- Useful for network-aware components or offline-first applications.
## Browser Support

@@ -202,0 +233,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc