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

@react-native-sandbox/docs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-sandbox/docs

A plugin for react-native-sandbox to enable support for documentation

  • 0.1.21
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
891
decreased by-28.15%
Maintainers
1
Weekly downloads
 
Created
Source

Adds flexible documentation to react-native-sandbox.

Installation

Requires react-native-sandbox. Ensure that your sandbox is configured correctly before proceeding.

Open a terminal in your project's folder and run

npm install @react-native-sandbox/docs

Modify your sandbox root to load the plugin:

import DocsPlugin from '@react-native-sandbox/docs';

// ...

function Sandbox() {
    return <SandboxRoot components={comonents} plugins={[DocsPlugin]}>
}

Usage

Documentation is registered to a sandbox by using the useDoc hook. At the moment this can only be called once per sandbox. The supported content type is text in the form of a string.

import MyComponent from './MyComponent';
import { useDocs } from '@react-native-sandbox/docs';
import documentation from './documentation.txt';


function MyComponentSandbox() {
    // renders a panel containing the provided content
    useDocs(documentation);

    return (<MyComponent />);
}

Support for additional content types such as Markdown and React coming soon.

Configuration

The plugin can be configured as follows:

import DocsPlugin from '@react-native-sandbox/docs';

// ...

const plugin = DocsPlugin.configure(options);

Where the following options are available:

KeyTypeDescription
rendererComponentTypeGlobal override for the default document renderer. Useful for customizing the way content is rendered. For example can replace with a markdown, PDF, or other renderer. Passes content prop with the value from the useDoc hook.

Keywords

FAQs

Package last updated on 17 Oct 2022

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

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