GitXplorerGitXplorer
j

react-prop-toggle

public
7 stars
2 forks
1 issues

Commits

List of commits on branch master.
Verified
d9279b5200d908121bfe795e372743db39ec221d

Merge pull request #2 from msftenhanceprovenance/patch-1

jjossmac committed 3 years ago
Verified
c0bcfcf117e1e259350d1eb1172c1310348e2c68

Update package.json to include the repository

mmsftenhanceprovenance committed 3 years ago
Verified
f76ef31c88f778b6bbf7643f63a87483b4843d69

add SimpleToggle example

jjossmac committed 7 years ago
Unverified
1e18f198d9ddc2044a4a7c7bf238f3a17983f2e8

update homepage ref

jjossmac committed 7 years ago
Unverified
8fa4a328171c2e2f4916f6a54d48d90b5a9cb40c

demo: cleanup

jjossmac committed 7 years ago
Unverified
79544e8dd33e45133164db3931c124668defd56f

demo: return footer styles

jjossmac committed 7 years ago

README

The README file for this repository.

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.

import PropToggle, { SimpleToggle } from 'react-prop-toggle';

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

// Or use SimpleToggle for a component that's already conditionally rendered
class Modal extends Component {
  render() {
    return (
      <div>
        <SimpleToggle
          attributes={{ 'data-variant': 'true' }}
          styles={{ background: 'red' }}
        />
      </div>
    );
  }
}