EQuimper / VSC-React-Native-React-Redux-Snippets

Snippets for React and React-Native with a bit of Redux for es6/es7 user.
https://marketplace.visualstudio.com/items?itemName=EQuimper.react-native-react-redux
55 stars 31 forks source link

Replace () with {} in Stateless Component #6

Closed freddydumont closed 7 years ago

freddydumont commented 7 years ago

This will fix the linting error produced because of the incorrect syntax (statement expected). Arrow function syntax: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

EQuimper commented 7 years ago

Hey @freddydumont thank you for this push :) About the () vs the {} I did that cause with the () we don't need to return. Javascript think of it in the same line. But yes I think we need this to the stack for the one who want to make logic before returning the react comp. Can you make it as a new snippets. I'm gonna add this. Maybe with like slr :) What you think of it

freddydumont commented 7 years ago

@EQuimper Aah I wasn't aware of this use case. Then slr might as well already have return(); That's the way I'm using it anyway. I'll update the PR.