+ * )}
+ *
+ * );
+ * }
* ```
*
* There are 4 main states a Transition can be in:
@@ -80,11 +84,15 @@ export const EXITING = 'exiting';
* [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
*
* ```jsx
+ * import { Transition } from 'react-transition-group';
+ * import { useState, useRef } from 'react';
+ *
* function App() {
* const [inProp, setInProp] = useState(false);
+ * const nodeRef = useRef(null);
* return (
*
- *
+ *
* {state => (
* // ...
* )}
@@ -390,9 +398,12 @@ class Transition extends React.Component {
Transition.propTypes = {
/**
- * A React reference to DOM element that need to transition:
+ * A React reference to the DOM element that needs to transition:
* https://stackoverflow.com/a/51127130/4671932
*
+ * - This prop is optional, but recommended in order to avoid defaulting to
+ * [`ReactDOM.findDOMNode`](https://reactjs.org/docs/react-dom.html#finddomnode),
+ * which is deprecated in `StrictMode`
* - When `nodeRef` prop is used, `node` is not passed to callback functions
* (e.g. `onEnter`) because user already has direct access to the node.
* - When changing `key` prop of `Transition` in a `TransitionGroup` a new
@@ -422,9 +433,9 @@ Transition.propTypes = {
* specific props to a component.
*
* ```jsx
- *
+ *
* {state => (
- *
+ *
* )}
*
* ```
diff --git a/www/.npmrc b/www/.npmrc
new file mode 100644
index 00000000..b6f27f13
--- /dev/null
+++ b/www/.npmrc
@@ -0,0 +1 @@
+engine-strict=true
diff --git a/www/package.json b/www/package.json
index efdf8b77..7bea35a4 100644
--- a/www/package.json
+++ b/www/package.json
@@ -12,6 +12,9 @@
},
"author": "",
"license": "MIT",
+ "engines": {
+ "node": "<=16"
+ },
"dependencies": {
"@babel/core": "^7.3.4",
"babel-preset-gatsby": "^2.7.0",