EX

Exenv

exenv

React's ExecutionEnvironment module extracted for use in other packages & components

Utilities
react
browser
server
environment
env
execution
executionenvironment
exenv
Utilities
javascript
Stars
537
Weekly
3.2M
Open issues
7
Bundle
~25 kB

Installation

npm install exenv

Code example

import { useExenv } from "exenv";

export function Example() {
  const value = useExenv();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Jed Watson
  • 3.2M weekly downloads. Battle tested
  • BSD-3-Clause licensed

Considerations

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

FAQs

Alternatives & similar libraries