react-emmet
react-emmet copied to clipboard
Have cursor end in a logical spot after the snippet is created.
Feature Request: Enhanced Cursor Placement for useState
and useEffect
Snippets
Description
When generating snippets for useState
and useEffect
using the Actual React Emmet extension, it would significantly enhance the developer experience if the cursor were automatically positioned within the snippet's editable area. Specifically, for useState
, the cursor should be inside the parentheses to quickly set the initial value. For useEffect
, it should be inside the code block to immediately write the effect's logic.
Expected Behavior
-
useState: After triggering a
useState
snippet (e.g.,usestate.counter
), the cursor should be placed inside the parentheses ofuseState()
, allowing the user to immediately type the initial state value. -
useEffect: For
useEffect
snippets, including both synchronous and asynchronous (e.g.,useeffect.loadData
oruseeffect.loadData.async
), the cursor should be placed inside the effect's function body, ready for the developer to start typing the logic.
This feature request aims to streamline the coding workflow, reducing the need for additional keystrokes or mouse clicks to navigate to the correct position in the snippet. It aligns with the goal of the Actual React Emmet extension to enhance productivity and ease of use.
PS I know I am opening an issue on my own codebase...i just don't want to forget about this.