Permalink
Showing
with
4 additions
and
4 deletions.
-
+4
−4
compat/src/index.js
|
|
@@ -1,6 +1,7 @@ |
|
|
import { render as preactRender, cloneElement as preactCloneElement, createRef, h, Component, options, toChildArray, createContext, Fragment } from 'preact'; |
|
|
import * as hooks from 'preact/hooks'; |
|
|
export * from 'preact/hooks'; |
|
|
import { assign } from '../../src/util'; |
|
|
|
|
|
const version = '16.8.0'; // trick libraries to think we are react |
|
|
|
|
@@ -292,7 +293,7 @@ function memo(c, comparer) { |
|
|
|
|
|
function Memoed(props) { |
|
|
this.shouldComponentUpdate = shouldUpdate; |
|
|
return h(c, { ...props }); |
|
|
return h(c, assign({}, props)); |
|
|
} |
|
|
Memoed.displayName = 'Memo(' + (c.displayName || c.name) + ')'; |
|
|
Memoed._forwarded = true; |
|
@@ -365,8 +366,7 @@ export { |
|
|
}; |
|
|
|
|
|
// React copies the named exports to the default one. |
|
|
export default { |
|
|
...hooks, |
|
|
export default assign({ |
|
|
version, |
|
|
Children, |
|
|
render, |
|
@@ -385,4 +385,4 @@ export default { |
|
|
PureComponent, |
|
|
memo, |
|
|
forwardRef |
|
|
}; |
|
|
}, hooks); |
0 comments on commit
79c7979