babel-sublime-snippets icon indicating copy to clipboard operation
babel-sublime-snippets copied to clipboard

Added stateless functional component skeleton

Open ezakto opened this issue 9 years ago • 4 comments

Pretty handy: https://facebook.github.io/react/docs/reusable-components.html#stateless-functions

ezakto avatar Jun 13 '16 13:06 ezakto

@MeKarina what do you mean? Arrow functions are plain javascript. If your env supports export or classes, it also supports arrow functions, right?

ezakto avatar Sep 28 '16 00:09 ezakto

+1 Be nice to know what people are doing now in the absence of this. (other then manual typing) Another snippet lib?

iDVB avatar Oct 12 '16 14:10 iDVB

both r correct n im not sure which better...

what i propose is airbnb style... and look like gain a lot traction...

https://github.com/airbnb/javascript

anyway u dont need cons... this also correct...

export default (props) => <div>Hello {props.name}</div>

MeKarina avatar Oct 28 '16 22:10 MeKarina

@MeKarina how about this one?

import React from 'react'

export default ({prop}) => (
   <div><div />
)

grundmanise avatar Feb 03 '17 09:02 grundmanise