Hooks
Last updated
Was this helpful?
Last updated
Was this helpful?
This folder should only contain JS files! There is no restriction on naming.
There is no access to component properties or the Elements API directly within these files. However, you may create a function and pass them in as properties.
Two components within an element pack display a description of the current temperature, chosen by the user using a called temperature
with a range of 0 to 40.
Instead of writing the same code twice in the of each component, define a function within a temperature.js
file and place it in the shared hooks directory, then add the following code.
Each component can then use the above function in their respective .