Skip to content

Commit

Permalink
Merge branch 'master' into old_css_string
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Mar 20, 2019
2 parents 0bf8f0d + d38ba1c commit 651702c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 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

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -365,8 +366,7 @@ export {
};

// React copies the named exports to the default one.
export default {
...hooks,
export default assign({
version,
Children,
render,
Expand All @@ -385,4 +385,4 @@ export default {
PureComponent,
memo,
forwardRef
};
}, hooks);
1 change: 1 addition & 0 deletions src/component.js
Expand Up @@ -21,6 +21,7 @@ export function Component(props, context) {
// Other properties that Component will have set later,
// shown here as commented out for quick reference
// this.base = null;
// this._context = null;
// this._ancestorComponent = null; // Always set right after instantiation
// this._vnode = null;
// this._nextState = null; // Only class components
Expand Down
1 change: 1 addition & 0 deletions src/internal.d.ts
Expand Up @@ -41,6 +41,7 @@ export interface Component<P = {}, S = {}> extends preact.Component<P, S> {
state: S; // Override Component["state"] to not be readonly for internal use, specifically Hooks
base?: PreactElement;

_context: any;
_dirty: boolean;
_renderCallbacks: Array<() => void>;
_vnode?: VNode<P> | null;
Expand Down

0 comments on commit 651702c

Please sign in to comment.