mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 16:52:39 +02:00
feat(v2): implement ComponentCreator (#1366)
* v2(feat): convert blog to view-driven content queries * feat(v2): port blog to use ContentRenderer * misc(v2): fix test and change ContentRenderer url * avoid chunkName collision * avoid chunkname collision more * fix(v2): fix content-renderer ssr problem (#1367) * wip * avoid chunk names collision * ContentRenderer is a wrapper for Loadable * convert docs and pages * nits and rename * rename routeModules -> modules * remove lodash from component creator * resolve chunk not being picked up correctly * add comment for explanation * small refactoring
This commit is contained in:
parent
0ac2441d23
commit
96cb4672d5
14 changed files with 220 additions and 80 deletions
|
@ -14,14 +14,14 @@ import Head from '@docusaurus/Head';
|
|||
import styles from './styles.module.css';
|
||||
|
||||
function DocBody(props) {
|
||||
const {metadata, modules} = props;
|
||||
const {metadata, content} = props;
|
||||
const {language, version} = metadata;
|
||||
const context = useContext(DocusaurusContext);
|
||||
useEffect(() => {
|
||||
context.setContext({metadata});
|
||||
}, []);
|
||||
|
||||
const DocContents = modules[0];
|
||||
const DocContents = content;
|
||||
return (
|
||||
<div className={styles.docBody}>
|
||||
<Head>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue