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
The layer does not render, this is because commit 4926e492cef3a77e57a8cdf7594e9340d499392e changed layer.ts's UNSAFE_componentWillMount to componentDidMount. With that change, render is called before initialize. Since on the initial render, the source is not defined, source.setData(...) is not called.
If something else triggers a render, like calling setState({}), the layer will pop in.
Suggested Fix
I think creating a constructor for the Layer class and calling this.initialize() in the constructor (rather than in componentDidMount will fix this issue.
The text was updated successfully, but these errors were encountered:
When a map has a layer something like this:
<Layer type="symbol" id="marker" layout={{ 'icon-image': 'school-15' }}>
<Feature coordinates={[-98.978340, 42.539770]} />
</Layer>
The layer does not render, this is because commit 4926e492cef3a77e57a8cdf7594e9340d499392e changed layer.ts's
UNSAFE_componentWillMount
tocomponentDidMount
. With that change,render
is called beforeinitialize
. Since on the initial render, the source is not defined, source.setData(...) is not called.If something else triggers a render, like calling setState({}), the layer will pop in.
Suggested Fix
I think creating a constructor for the Layer class and calling
this.initialize()
in the constructor (rather than in componentDidMount will fix this issue.The text was updated successfully, but these errors were encountered: