tradle / rn-markdown

basic markdown renderer for react-native using the great https://github.com/chjj/marked parser
https://tradle.github.io/rn-markdown-playground/
MIT License
22 stars 9 forks source link

react-native-web #6

Open AareFabrik opened 5 years ago

AareFabrik commented 5 years ago

How to make it work with react-native-web? Any example would be nice.

I tried the package but i always get this Error:

./node_modules/rn-markdown/markdown.js SyntaxError: .../node_modules/rn-markdown/markdown.js: Unexpected token (116:6)

  114 | 
  115 |     return (
> 116 |       <El {...elProps}>
      |       ^
  117 |         {contents}
  118 |       </El>
  119 |     )
mvayngrib commented 5 years ago

there's an example linked in the readme, but here you go: https://github.com/tradle/rn-markdown-playground/blob/master/src/scenes/App/App.js

make sure you have webpack set up to transpile this lib: https://github.com/tradle/rn-markdown-playground/blob/master/web/webpack.config.js#L20