2

I love RN but one issue that is really annoying me is lack of conventions. I'm used to it a bit as a js developer. But using ES6 or not

render() { vs. render: function() {

is one thing. What I really can't understand is when I saw the WebView module export example as

exports.examples = [
  {
    title: 'WebView',
    render(): ReactElement { return <WebViewExample />; }
  }
]; 

And sometimes I see

export default PDFView;

I'm used to

module.exports = WebViewExample

Returning an object breaks my code and forces me to think about what type I should expect from each component. I understand the value of returning an object but it seems like a bad thing to start introducing in the docs. End of rant. What is default is for?

ssomnoremac
  • 729
  • 1
  • 8
  • 16
  • It's frustrating for sure. But could please you clarify your question? It's not clear what you're asking. Thanks! – David Kay Feb 01 '16 at 19:34
  • http://stackoverflow.com/questions/31852933/why-es6-react-component-works-only-with-export-default – Ork Eang Sep 07 '16 at 10:49

0 Answers0