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 11import "./styles/index.css" ;
2- import React from "react" ;
2+ import React , { useEffect } from "react" ;
33
44import { Page } from "@/models/generated" ;
55// import { validateAgainstSchema } from "@/validation/validator";
66
7+ import { loadBlock , loadPage } from "@/serialization/loader" ;
8+
79import { BlockRenderer } from "./components/BlockRenderer" ;
810import { PageDelimiter } from "./components/PageDelimiter" ;
911import { JsonViewPanel } from "./components/dev/JsonViewPanel" ;
@@ -46,6 +48,15 @@ export const JsonDocRenderer = ({
4648 backrefs,
4749 } ) ;
4850
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+
4960 // return null;
5061 const renderedContent = (
5162 < div className = "json-doc-page" >
You can’t perform that action at this time.
0 commit comments