File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ export class DocWidget extends Widget {
5656 if ( this . isAttached ) {
5757 const content = this . _context . model . toString ( ) ;
5858 try {
59- const { resources : [ props ] } = JSON . parse ( content ) ;
60- ReactDOM . render ( < JSONTable { ... props } /> , this . node ) ;
59+ const { data , schema } = JSON . parse ( content ) ;
60+ ReactDOM . render ( < JSONTable data = { data } schema = { schema } /> , this . node ) ;
6161 } catch ( error ) {
6262 const ErrorDisplay = props => (
6363 < div
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ export class OutputWidget extends Widget {
3939 * A render function given the widget's DOM node.
4040 */
4141 _render ( ) {
42- const { resources : [ props ] } = this . _data . get ( this . _mimeType ) ;
42+ const { data , schema } = this . _data . get ( this . _mimeType ) ;
4343 // const metadata = this._metadata.get(this._mimeType);
44- if ( props ) ReactDOM . render ( < JSONTable { ... props } /> , this . node ) ;
45- // Inject static HTML into mime bundle
44+ // if (data)
45+ ReactDOM . render ( < JSONTable data = { data } schema = { schema } /> , this . node ) ;
4646 this . _data . set (
4747 'text/html' ,
48- ReactDOMServer . renderToStaticMarkup ( < JSONTable { ... props } /> )
48+ ReactDOMServer . renderToStaticMarkup ( < JSONTable data = { data } schema = { schema } /> )
4949 ) ;
5050 }
5151}
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ const CLASS_NAME = 'output_JSONTable rendered_html';
1010/**
1111 * Render data to the output area
1212 */
13- function render ( data , node ) {
14- const { resources : [ props ] } = data ;
15- ReactDOM . render ( < JSONTable { ... props } /> , node ) ;
13+ function render ( json , node ) {
14+ const { data , schema } = json ;
15+ ReactDOM . render ( < JSONTable data = { data } schema = { schema } /> , node ) ;
1616}
1717
1818/**
You can’t perform that action at this time.
0 commit comments