File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import "./styles/index.css" ;
2
- import React from "react" ;
2
+ import React , { useEffect } from "react" ;
3
3
4
4
import { Page } from "@/models/generated" ;
5
5
// import { validateAgainstSchema } from "@/validation/validator";
6
6
7
+ import { loadBlock , loadPage } from "@/serialization/loader" ;
8
+
7
9
import { BlockRenderer } from "./components/BlockRenderer" ;
8
10
import { PageDelimiter } from "./components/PageDelimiter" ;
9
11
import { JsonViewPanel } from "./components/dev/JsonViewPanel" ;
@@ -46,6 +48,15 @@ export const JsonDocRenderer = ({
46
48
backrefs,
47
49
} ) ;
48
50
51
+ useEffect ( ( ) => {
52
+ try {
53
+ //TODO: this is not throwing for invalid page object (one that doesn't follow schema)
54
+ const serialized = loadPage ( page ) ;
55
+ } catch ( error ) {
56
+ // console.log("error ", error);
57
+ }
58
+ } , [ ] ) ;
59
+
49
60
// return null;
50
61
const renderedContent = (
51
62
< div className = "json-doc-page" >
You can’t perform that action at this time.
0 commit comments