Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@times-stories/context

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-stories/context

> The React context provider for the `@times-stories` suite of packages

latest
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

@times-stories/context

The React context provider for the @times-stories suite of packages

Installation

$ yarn add @times-stories/context

Usage

It is unlikely you'll ever need to use this directly, unless you're building custom page templates.

Below is an example how how this can be used to create a page with a custom navigation element (much like how @times-stories/end-page works).

import Story from "@times-stories/story";
import Page from "@times-stories/page";
import StoryContext from "@times-stories/context";

export default () => (
  <Story>
    <Page>
      {props => (
        <StoryContext.Consumer>
          {({ handlers }) => (
            <button onClick={handlers.setActivePage(1)}>
              Reset to first page
            </button>
          )}
        </StoryContext.Consumer>
      )}
    </Page>
  </Story>
);

FAQs

Package last updated on 09 Nov 2018

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