SolidJSS
SolidJSโ€ข3y agoโ€ข
18 replies
Davide

Context undefined when called from a function in onClick, but not if called in component

I have a component which has a button that onClick calls a function. That function tries to access a few contexts but they are all undefined. If I try to access the contexts from the caller component they work. Is there a specific reason why this happens? Any workarounds aside from passing down all the contexts to the function every time?
Was this page helpful?