Im having troubles using the events map handler as mentioned in the docs with react context api
i have this map for the events which works fine, but when i try to read values inside the rendered event those values are never updated, even when the actual values change from the context
this funciton comes from a react context, which returns an array of places ['city1' 'city2'], however every time to read this variable inside the rendered event, is always the same original initial state declared in the context creation, it never updates with the context
const eventHandlersMap = new Map([
[
"rendered",
(event: any, report: any) => {
// here I try to read the values of a mapFilterslist variable
but its always an empty array
onReportRerender();
},
],
[
"dataSelected",
(event: service.ICustomEvent<any>, report: Report) => {
// here I store the details of the event in a context
// which works fine i can see the changes in the context every time
},
],
])
Im having troubles using the events map handler as mentioned in the docs with react context api
i have this map for the events which works fine, but when i try to read values inside the rendered event those values are never updated, even when the actual values change from the context
this funciton comes from a react context, which returns an array of places ['city1' 'city2'], however every time to read this variable inside the rendered event, is always the same original initial state declared in the context creation, it never updates with the context
here is the return