Last active
          November 7, 2018 17:51 
        
      - 
      
- 
        Save antmdvs/63903d7f98f8d82d0c6463abebb77cd7 to your computer and use it in GitHub Desktop. 
    Snippets for React's *EXPERIMENTAL* `useState()` hook -- See https://reactjs.org/hooks
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              Show hidden characters
| { | |
| "useState()": { | |
| "prefix": "us", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState($2);", | |
| "$0" | |
| ], | |
| "description": "React: useState()" | |
| }, | |
| "useState(true)": { | |
| "prefix": "ust", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState(true);", | |
| "$0" | |
| ], | |
| "description": "React: useState(true)" | |
| }, | |
| "useState(false)": { | |
| "prefix": "usf", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState(false);", | |
| "$0" | |
| ], | |
| "description": "React: useState(false)" | |
| }, | |
| "useState(null)": { | |
| "prefix": "usn", | |
| "scope": "javascript,javascriptreact,typescript,typescriptreact", | |
| "body": [ | |
| "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState(null);", | |
| "$0" | |
| ], | |
| "description": "React: useState(null)" | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment