DEV Community

Discussion on: Hacking React Hooks: Shared Global State

Collapse
 
laurentsenta profile image
Laurent Senta

Hi Pedro,
typescript is pretty explicit, there is no counter field on the global object,

you have to declare the type so the compiler can do its job. Here is an example:
mariusschulz.com/blog/declaring-gl...