react-native-markdown-transformer
v0.1.3
Published
react native markdown transformer
Downloads
52
Readme
React Native Markdown Transformer
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