To use hooks, add them to the module:

var MyHook = () => ( < div > Hello world ! < / div > )

In the first example, we have set up a local ref in our hook function, as well as a global one, so both hooks can reference their respective variables.

The second example will take advantage of the function application (an arrow function) feature:

( function ( require ) { require ( ‘ www/app/MyHook ‘ )(MyHook); })();

The basic idea is to create a new Ref object whenever you use a hook, and use the main code that is associated with the ref


Marco Lopes

Excessive Crafter of Things

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *