You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not working as expected though. For this to work, I have to set contextKey to a "string" for it to successfully getContext in svelte.in the mapbox.js file I am importing.
I am currently experimenting with using svelte-mapbox in my project.
As part of this, I have built a custom 'mapLine.svelte' component.
I am trying to getContext in the following way:
import { contextKey } from '@beyonk/svelte-mapbox/src/lib/mapbox' const { getMap } = getContext(contextKey);
This is not working as expected though. For this to work, I have to set
contextKey
to a "string" for it to successfullygetContext
in svelte.in themapbox.js
file I am importing.mapbox.js file updated from:
const contextKey = {} export { contextKey }
to
const contextKey = "contextKey" export { contextKey }
Keen to understand the correct way to do this.
The other thing I tried was to set the
contextKey
in my project, and pass this in as a parameter to @beyonkMap.svelte
component. this also worked..What is the recommended way to achieve custom components with this library?
The text was updated successfully, but these errors were encountered: