All notable changes to the "Actual React Emmet" extension will be documented in this file.
-
Added support for
useEffect
snippets:-
Type
useeffect.<functionName>
and press Enter to create auseEffect
hook.-
For example:
useeffect.fetchData
will create: -
useEffect(() => { function fetchData() { // Your code here } fetchData(); }, []);
-
-
You can also create an async
useEffect
by typinguseeffect.<functionName>.async
.-
For example:
useeffect.loadData.async
will create:useEffect(() => { async function loadData() { // Your code here } await loadData(); }, []);
-
-
Dependency array support: Append
[arg1, arg2]
to specify dependencies.-
For example:
useeffect.updateData[arg1, arg2]
will create:useEffect(() => { function updateData() { // Your code here } updateData(); }, [arg1, arg2]);
-
-
- Fixed an error where users couldn't go to the next line unless it contained the word
useState
.
- Fixed an error where the snippet was only created at the top level of a file.
- Fixed an error where snippets were always created no matter what file type was being edited.
- Made
useState
case insensitive so that auto capitalization will not affect the extension. - Added an icon image.
- Type
usestate.<varName>
and press Enter to automatically create auseState
snippet with the variable name.- For example:
useState.name
will createconst [name, setName] = useState();
- For example:
useState.age
will createconst [age, setAge] = useState();
- Use any variable name you want, and it will generate it for you.
- For example: