Methods

(inner) UserDocumentation(initialDataopt, onStateChange, savedStateopt) → {JSX.Element}

A component for displaying user documentation from markdown files.

Parameters:
NameTypeAttributesDescription
initialDataObject<optional>

Initial data. Contain path and content. If content is defined, this component will not fetch and display the passed content. Otherwise will fetch the path.

onStateChangefunction

Call back function to let parent component know about state change

savedStateObject<optional>

Saved state. Contain path and content. If content is defined, this component will not fetch and display the passed content. Otherwise will fetch the path.

Returns:

Rendered documentation component

Type: 
JSX.Element
Example
// Basic usage
<UserDocumentation />

// To open this page as new tab, dispatch event as follows
const event = new CustomEvent('addDocumentationTab', {
    detail: {

        // String
        path: 'stimulation',

        // Markdown String
        // If content is defined, the component will display that instead of fetching the path.
        // Otherwise it will fetch using the path
        content: "Content"
    }
});
window.dispatchEvent(event);