0

[@bs.module] external navigator: unit = "window.navigator";

giving following error Module not found: Can't resolve 'window.navigator'

How to access the windows.navigator in ReasonML?

glennsl
  • 28,186
  • 12
  • 57
  • 75
Nimish Gupta
  • 971
  • 7
  • 17

1 Answers1

0

window.navigator is not a module, but a "global value", so you should use @bs.val instead:

[@bs.val] external navigator: unit = "window.navigator";

See the documentation on how to Bind to Global Values for more details.

glennsl
  • 28,186
  • 12
  • 57
  • 75