This gatsby theme supports writing mdx
files in your docs. Complete documentation for mdx
can be found here.
import { Button } from 'reactstrap';<Button color="primary">Click Me</Button>;
When importing ES6 components like @availity/app-icon
you may have to include a custom plugin in order to precompile the code.
npm install gatsby-plugin-compile-es6-packages
module.exports = {// ... usual configsplugins: [{// For compiling es6 componentsresolve: `gatsby-plugin-compile-es6-packages`,options: {modules: ['@availity/app-icon'],},},],};
In some cases, a component may require access to the global window
object, or some other native DOM related object. In these scenarios the mdx components will fail to render because the way gatsby builds the site is via SSR (Server Side Rendering).
You can read up more on this article about how gatsby recommends fixing this issue or continue below to see how we do it.
npm install @loadable/component
import loadable from '@loadable/component';export default loadable(() => import('@availity/page-header'));
import PageHeader from './PageHeader';<PageHeader appName="Payer Space" appAbbr="PS" iconColor="blue" />;
Note you can also hit the "Edit On Github" Button to view the source code for how we rendered this page if you need assistance replicating this.