React js snippets for Atom
Usage
apm install react-atom-snips
Snippets
Name | Snippet |
---|---|
import React from 'react'; |
imr |
import React,{ Component } from 'react'; |
imrc |
Export default | ed |
function component | rfc |
class component | rcc |
createRef | createref |
createContext | createcontext |
Hooks
Name | Snippet |
---|---|
useState hook | usestate |
useEffect hook | useeffect |
useCallback hook | usecallback |
useContext hook | usecontext |
useReducer hook | usereducer |
useMemo hook | usememo |
useRef hook | useref |
Custom hooks
Name | Snippet |
---|---|
useFetch custom hook | usefetch |
useStore custom hook | usestore |
ReactDom
Name | Snippet |
---|---|
render() | rrdom |
createPortal() | rcp |
Typechecking With PropTypes
Name | Snippet |
---|---|
PropTypes | rproptypes |
React lists
Name | Snippet |
---|---|
elements | rcmap |
const numbers = [1, 2, 3, 4, 5];
const listItems = numbers.map((number) => <li key={number}>{number}</li>);
Contributing
- Fork repository
- Create your branch:
git checkout -b my-new-branch
- Commit your changes:
git commit -m 'Add some new features'
- Push to the branch:
git push origin my-new-branch
- Submit a pull request ✔
Contributions are greatly appreciated. Please feel free..
License
MIT