You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@asphalt-react/context

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asphalt-react/context

share context among asphalt components

latest
npmnpm
Version
2.13.0
Version published
Maintainers
6
Created
Source

@asphalt-react/context

npm

⚠️ Designed for Asphalt React component packages. Use at your own risk, if using externally.

A package which contains a React context which is to be shared among asphalt components.

Why

There are use cases, where two different packages need to communicate. In such cases, rather than creating inter-package dependency, they both can import @asphalt-react/context and use Provider and Consumer from it.

Usage

Provider

import Component2 from "@asphalt-react/component"
import { Provider } from "@asphalt-react/context"

export default (Component = () => (
  <Provider value={{ id: 1 }}>
    <Component2 />
  </Provider>
))

Consumer

import { Provider } from "@asphalt-react/context"

export default (Component2 = () => (
  <Consumer>{({ id }) => <span>{id}</span>}</Consumer>
))

Keywords

asphalt

FAQs

Package last updated on 19 Feb 2026

Did you know?

Socket

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.

Install

Related posts