0

I have a window variable accessible in my webview like window.x Android/iOS is changing the value of x based on certain conditions, problem is this value changes but react is not able to rerender based on said change since its not a state.

Is there any way to fire a callback when this value changes without polling it continuously?

2
  • If you know which function is changing the variable, you can hook into it and add handler that runs after it. Something like this Commented Jan 5, 2023 at 8:34
  • @Brother58697 the code triggering the variable change is running in Android/iOS native code, can I trigger an event in react from native code via a method channel or something? Commented Jan 5, 2023 at 13:12

1 Answer 1

0

Found a better way to communicate events to a webview running on Android/iOS, requires minor changes to native code.

How to trigger webview events from native code

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.