File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
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,12 +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 ) ;
44+ // if (data)
45+ ReactDOM . render ( < JSONTable data = { data } schema = { schema } /> , this . node ) ;
4546 this . _data . set (
4647 'text/html' ,
47- ReactDOMServer . renderToStaticMarkup ( < JSONTable { ... props } /> )
48+ ReactDOMServer . renderToStaticMarkup ( < JSONTable data = { data } schema = { schema } /> )
4849 ) ;
4950 }
5051}
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ const CLASS_NAME = 'output_JSONTable rendered_html';
99/**
1010 * Render data to the output area
1111 */
12- function render ( data , node ) {
13- const { resources : [ props ] } = data ;
14- ReactDOM . render ( < JSONTable { ... props } /> , node ) ;
12+ function render ( json , node ) {
13+ const { data , schema } = json ;
14+ ReactDOM . render ( < JSONTable data = { data } schema = { schema } /> , node ) ;
1515}
1616
1717/**
You can’t perform that action at this time.
0 commit comments