Skip to content

Commit c0bf408

Browse files
committed
reactUtils: Add ElementConfigFull
1 parent f07e3ba commit c0bf408

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/reactUtils.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
import invariant from 'invariant';
33
import * as React from 'react';
44

5+
/**
6+
* Like React.ElementConfig, but includes the pseudoprops `ref` and `key`.
7+
*
8+
* That is, this contains exactly the set of JSX attributes one can pass
9+
* when creating an element of this component-type.
10+
*
11+
* Assumes the underlying props type is an exact object type.
12+
*/
13+
export type ElementConfigFull<+C> = {|
14+
...$Exact<React.ElementConfig<C>>,
15+
+ref?: React.Ref<C>,
16+
+key?: React.Key,
17+
|};
18+
519
/**
620
* A Hook for the value of a prop, state, etc., from the previous render.
721
*

0 commit comments

Comments
 (0)