https://github.com/jossmac/react-prop-toggle
🕹 Influence nodes outside your app's render tree
https://github.com/jossmac/react-prop-toggle
Last synced: about 1 year ago
JSON representation
🕹 Influence nodes outside your app's render tree
- Host: GitHub
- URL: https://github.com/jossmac/react-prop-toggle
- Owner: jossmac
- License: mit
- Created: 2018-04-28T04:20:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-11T02:09:42.000Z (over 4 years ago)
- Last Synced: 2025-05-08T05:57:25.359Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://jossmac.github.io/react-prop-toggle
- Size: 158 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```jsx
import PropToggle, { SimpleToggle } from 'react-prop-toggle';
// Use PropToggle with `isActive` prop
// Or use SimpleToggle for a component that's already conditionally rendered
class Modal extends Component {
render() {
return (
);
}
}
```