Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frint-props-react

Package Overview
Dependencies
Maintainers
9
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frint-props-react

React higher-order component FrintJS Apps

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created
Source

frint-props

npm

Compose props reactively in FrintJS Apps


Guide

Installation

With npm:

$ npm install --save frint-props frint-react

Via unpkg CDN:

<script src="https://unpkg.com/frint-props@latest/dist/frint-props.min.js"></script>
<script>
  // available as `window.FrintProps`
</script>

Usage

The package exposes a compose higher-order component, that is similar to the one found in frint-props.

You can use it as follows:

import React from 'react';
import { withDefaults, withState } from 'frint-props';
import { compose } from 'frint-props-react';

function MyComponent(props) {
  // props.counter (`Integer`)
  // props.setCounter (`Function`)
}

export default compose(
  withDefaults({ counter: 0 }),
  withState('counter', 'setCounter', 0)
)(MyComponent);

API

compose

compose(...functions)(Component)

Higher-order component in React.

Arguments

Accepts multiple functions as available in frint-props. The returned function is an enhancer that can be called directly with your base React component.

Keywords

FAQs

Package last updated on 29 Mar 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

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