react-native-markdown-transformer

    0.1.3 • Public • Published

    React Native Markdown Transformer

    Build Status npm version npm downloads

    Usage

    import Markdown from 'react-native-markdown-display';
    import article from 'article.md';
     
    export default function App() {
      return <Markdown>{article}</Markdown>;
    }

    Setup

    yarn add --dev react-native-svg-transformer

    For React Native v0.57 or newer

    metro.config.js

    const { getDefaultConfig } = require('metro-config');
     
    module.exports = (async () => {
      const {
        resolver: { sourceExts },
      } = await getDefaultConfig();
      return {
        transformer: {
          babelTransformerPath: require.resolve(
            './scripts/react-native-markdown-transformer'
          ),
          getTransformOptions: async () => ({
            transform: {
              experimentalImportSupport: false,
              inlineRequires: false,
            },
          }),
        },
        resolver: {
          sourceExts: [...sourceExts, 'md'],
        },
      };
    })();

    Typescript

    declare module '*.md' {
      const content: string;
      export default content;
    }

    Todo

    • Unit Test

    Keywords

    none

    Install

    npm i react-native-markdown-transformer

    DownloadsWeekly Downloads

    2

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    4.98 kB

    Total Files

    5

    Last publish

    Collaborators

    • roadmanfong