Skip to content

Commit

Permalink
proppy-preact: fix for tests (but with warnings). Refs #38
Browse files Browse the repository at this point in the history
  • Loading branch information
fahad19 committed Oct 11, 2018
1 parent 2b35b6f commit dd6294d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions packages/proppy-preact/src/ProppyProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { h, Component } from 'preact';

import { ProppyContext } from './ProppyContext';
import { Component } from 'preact';

/**
* Source: https://gist.github.com/developit/5d879edb820228224dc9
*/
export class ProppyProvider extends Component {
public render({ children, providers }) {
return (
<ProppyContext.Provider value={providers}>
{children}
</ProppyContext.Provider>
);
public getChildContext() {
const { children, ...context } = this.props;

return context;
}

public render({ children }) {
return (children && children[0]) || null;
}
}
2 changes: 1 addition & 1 deletion packages/proppy-preact/src/attach.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsx h */
import { h, Component } from 'preact';
import { compose, withState, withProps, map } from 'proppy';
import * as RenderSpy from 'preact-render-spy'
import * as RenderSpy from 'preact-render-spy';
import { resetDOM } from 'frint-test-utils';

import { attach } from './attach';
Expand Down

0 comments on commit dd6294d

Please sign in to comment.