RE

React Side Effect

react-side-effect

Create components whose prop changes map to a global side effect

Component Libraries
react
component
side
effect
react-side-effect
Component Libraries
javascript
npm
frontend
open source
Stars
1.2k
Weekly
3.1M
Open issues
15
Bundle
~25 kB

Installation

npm install react-side-effect

Code example

import { Button } from "react-side-effect";

export function Example() {
  return (
    <div className="flex gap-2">
      <Button>Primary</Button>
      <Button variant="outline">Secondary</Button>
    </div>
  );
}

Pros & cons

Pros

  • Actively maintained by Dan Abramov
  • 3.1M weekly downloads. Battle tested
  • MIT licensed

Considerations

  • Adds roughly ~25 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 15 open issues on GitHub

FAQs

Alternatives & similar libraries