react-prop-toggle

1.0.2 • Public • Published

React Prop Toggle

A safe, declarative way to influence the styles and attributes of nodes outside your app's tree.

By storing the initial values of the target node when mounting react-prop-toggle is able to safely return styles and attributes when unmounted.

<PropToggle
  isActive={this.state.someCondition}
  attributes={{ 'data-variant': 'true' }}
  styles={{ background: 'red' }}
/>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    23,482
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    23,482
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i react-prop-toggle

Weekly Downloads

23,482

Version

1.0.2

License

MIT

Unpacked Size

215 kB

Total Files

7

Last publish

Collaborators

  • jossmac