grafana/ui: Enable mdx imports in stories (#19937)

This commit is contained in:
Dominik Prokop
2019-10-22 09:05:14 +02:00
committed by GitHub
parent 80a6853fd4
commit 2a8762f6a3
4 changed files with 12 additions and 3 deletions
@@ -73,7 +73,7 @@ module.exports = ({ config, mode }) => {
],
});
config.resolve.extensions.push('.ts', '.tsx');
config.resolve.extensions.push('.ts', '.tsx', '.mdx');
config.stats = {
warningsFilter: /export .* was not found in/,
};
@@ -0,0 +1,3 @@
# Switch
A basic docs for Switch component
@@ -1,14 +1,16 @@
import React, { useState } from 'react';
// import { storiesOf } from '@storybook/react';
// import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { Switch } from './Switch';
import { text } from '@storybook/addon-knobs';
import mdx from './Switch.mdx';
const getStory = (title: string, component: any) => ({
title,
parameters: {
component,
docs: {
page: mdx,
},
},
});
+4
View File
@@ -0,0 +1,4 @@
declare module '*.mdx' {
let MDXComponent: (props: any) => JSX.Element;
export default MDXComponent;
}