79573994

Date: 2025-04-14 21:04:12
Score: 1.5
Natty:
Report link

This also affects AlpineJS. Make sure you define the map variable outside your reactive component!

This works: <div id="my_map" x-data="(() => { let map = null; return { markers: [], ...

This doesn't: <div id="my_map" x-data="(() => { return { map: null, markers:[], ...

Glad I found this post. @Javier's response saved me.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Javier's
  • Low reputation (1):
Posted by: Robin Darlington