@restart/context

WebJar for @restart/context

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

restart__context
Last Version

Last Version

2.1.4
Release Date

Release Date

Type

Type

jar
Description

Description

@restart/context
WebJar for @restart/context
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/react-restart/context

Download restart__context

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/restart__context/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>restart__context</artifactId>
    <version>2.1.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/restart__context/
implementation 'org.webjars.npm:restart__context:2.1.4'
// https://jarcasting.com/artifacts/org.webjars.npm/restart__context/
implementation ("org.webjars.npm:restart__context:2.1.4")
'org.webjars.npm:restart__context:jar:2.1.4'
<dependency org="org.webjars.npm" name="restart__context" rev="2.1.4">
  <artifact name="restart__context" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='restart__context', version='2.1.4')
)
libraryDependencies += "org.webjars.npm" % "restart__context" % "2.1.4"
[org.webjars.npm/restart__context "2.1.4"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

@restart/context npm

React context helpers.

Install

npm install @restart/context

Usage

import React from 'react';
import mapContextToProps from '@restart/context/mapContextToProps';

const MyValueContext = React.createContext(null);

function MyComponent(props) {
  /* ... */
}

const MyComponentWithMyValue = mapContextToProps(
  MyValueContext,
  myValue => ({ myValue }),
  MyComponent,
);

const withMyValue = Component =>
  mapContextToProps(
    {
      consumers: MyValueContext,
      mapToProps: myValue => ({ myValue }),
      displayName: `withMyValue(${Component.displayName || Component.name})`,
    },
    Component,
  );
org.webjars.npm
A loose suite of style agnostic components, a11y primitives, and react utilities (icon: https://webkul.github.io/vivid/)

Versions

Version
2.1.4