Skip to content

Boost Your Productivity: Must-Know React and Visual Studio Code Shortcuts

Posted in Education, and WhoCodeFirst

The following are the some commonly used shortcuts for working with React and Visual Studio Code:

React-specific shortcuts:

  1. rafce – Create a new React functional component with an export statement.
  2. rcc – Create a new React class component with an export statement.
  3. imr – Import the React module.
  4. imrc – Import the React module and the current component.
  5. imrn – Import the React module and a React Native component.
  6. useState – Import the useState hook.
  7. useEffect – Import the useEffect hook.
  8. useContext – Import the useContext hook.
  9. useReducer – Import the useReducer hook.
  10. useCallback – Import the useCallback hook.
  11. useMemo – Import the useMemo hook.

Visual Studio Code shortcuts:

  1. Ctrl + / (Windows) or Cmd + / (Mac) – Toggle line comment for the selected line(s) or the current line if nothing is selected.
  2. Ctrl + Shift + / (Windows) or Cmd + Shift + / (Mac) – Toggle block comment for the selected lines.
  3. Ctrl + B (Windows) or Cmd + B (Mac) – Toggle the sidebar.
  4. Ctrl + Shift + P (Windows) or Cmd + Shift + P (Mac) – Open the command palette.
  5. Ctrl + P (Windows) or Cmd + P (Mac) – Quick file navigation and search.
  6. Ctrl + F (Windows) or Cmd + F (Mac) – Find text in the current file.
  7. Ctrl + H (Windows) or Cmd + F (Mac) – Replace text in the current file.
  8. Ctrl + Shift + F (Windows) or Cmd + Shift + F (Mac) – Find text in all files in the workspace.
  9. Ctrl + Shift + H (Windows) or Cmd + Shift + F (Mac) – Replace text in all files in the workspace.
  10. Ctrl + S (Windows) or Cmd + S (Mac) – Save the current file.

These are just a few shortcuts to get you started. Visual Studio Code has many more shortcuts, and you can customize them to fit your workflow.

You can find the full list of default shortcuts and customize them by going to “File” > “Preferences” > “Keyboard Shortcuts” in Visual Studio Code.

If you enjoyed this article, Get email updates (It’s Free)

0
Translate »