UNPKG

699 BTypeScriptView Raw
1import * as React from 'react';
2import renderer from '@platform/electron/lib/renderer';
3import { Test } from './components/Test';
4
5/**
6 * [Note] example <App> root provides access to the
7 * electron context properties passed down via <Provider>
8 * that is injected within `renderer.render(...)`.
9 */
10export class App extends React.PureComponent {
11 public static contextType = renderer.Context;
12 public context!: renderer.ReactContext;
13
14 public render() {
15 return <Test />;
16 }
17}
18
19/**
20 * [Renderer] entry-point.
21 *
22 * Reference your component(s) here or pull in the [UIHarness]
23 * visual testing host.
24 */
25renderer.render(<App />, 'root').then(context => context.log.info('renderer loaded!'));