planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

35
node_modules/exenv/README.md generated vendored Normal file
View File

@@ -0,0 +1,35 @@
# exenv
React's ExecutionEnvironment module extracted for use in other packages & components.
## Usage
```
npm install exenv --save
```
```js
var ExecutionEnvironment = require('exenv');
// You now have...
ExecutionEnvironment.canUseDOM // is the DOM available? i.e window document etc.
ExecutionEnvironment.canUseWorkers // are Web Workers available?
ExecutionEnvironment.canUseEventListeners // are Events available? i.e addEventListener etc.
ExecutionEnvironment.canUseViewport // is there a viewport? i.e window.screen
```
### Differences from React's ExecutionEnvironment
The `ExecutionEnvironment` lib in React 0.13 includes an `isInWorker` property, which is `!canUseDOM`. This is highly specific to React internals and probably (a) hacky and (b) not useful to other packages, so it has been left out. Please open an issue with your thoughts if you disagree or have a better idea.
## Why?
A number of packages and components use React's private ExecutionEnvironment lib to detect available features, particularly to detect server-side rendering, e.g
```
canUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM; // BAD
```
**It is bad practice to use React internals** and this is likely to be broken / disabled in the future.
Use this package instead!