MCPcopy Create free account
hub / github.com/callstack/react-native-paper / loadContent

Function loadContent

docs/component-docs-plugin/index.js:58–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 return {
57 name: pluginName,
58 async loadContent() {
59 // Clean up docs directory.
60 clean();
61 // Create root components category.
62 createCategory('Components', '.');
63
64 const docs = {};
65
66 for (const item in pages) {
67 if (typeof pages[item] === 'string') {
68 const doc = createPageForComponent([item], pages[item]);
69 docs[pages[item]] = doc;
70 } else {
71 for (const subitem in pages[item]) {
72 const doc = createPageForComponent(
73 [item, subitem],
74 pages[item][subitem]
75 );
76 docs[pages[item][subitem]] = doc;
77 }
78 }
79 }
80
81 return docs;
82 },
83 async contentLoaded({ content: docs, actions }) {
84 // Store component docs global data so it can be used in `PropsTable` component.
85 actions.setGlobalData({

Callers

nothing calls this directly

Calls 3

cleanFunction · 0.85
createCategoryFunction · 0.85
createPageForComponentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…