virtualdom.create.tsx 289 B

1234567891011
  1. import * as React from 'react';
  2. import { Widget } from '@lumino/widgets';
  3. import { ReactWidget } from '@jupyterlab/apputils';
  4. function MyComponent() {
  5. return <div>My Widget</div>;
  6. }
  7. const myWidget: Widget = ReactWidget.create(<MyComponent />);
  8. Widget.attach(myWidget, document.body);