-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to pass actual javascript objects to data
#83
Comments
Hi @chandlervdw, Im not sure how it should be parsed when i.e you add a data. Could you paste an example? Its a second example of requiremenet, so I need to check it deeper. |
@sebastianbochan it’s as simple as trying to pass an object like this:
Within the Webview's javascript scope, Is that clear enough? |
@sebastianbochan no word from you for 3 weeks. 😭 This bug is likely going to prevent us from using this library. Is there anything I can do to help push this forward? |
I apologize for late reply, I did not receive notification about your answer. Now its clear, but we cannot consider it as a bug, but as feature request. I will try to add this option, next week. EDIT: Is it a custom param for the particular version of webview or something? |
@sebastianbochan thanks for the response and the effort towards this request. But the documentation you referenced is deprecated and isn't the webview library you're using in this project. You're using
Maybe you want to consider But I don't know if the issue surrounding setting a JSON string as a window global will persist (the main issue I shared here), and so I'm unsure why this is considered an enhancement instead of a bug. Remember, I'm trying to access information living in my RN code from within the webview. The whole premise of your Lastly, it looks like the way you're using |
Sorry, my mistake about the docs. Im using the Summarising: the |
Is this fixed in the latest release? |
@sebastianbochan Any update on this issue would be appreciated. |
Hello @astron97 @aditya1711 @chandlervdw , First of all, really apologize for the silence in this topic. I've just took a look on it, and realized it does not work correctly in the new version. Also found the reason, and will fix the Kind regards, and thank you for your patience! |
When trying to render a tooltip, the
data
API option led me down a rabbit hole into the darkest depths of Mordor.To render useful info in a tooltip, I need to access information living in my RN code from within the webview. "Ah, the
data
option looks promising," I said to myself. Boy, was I wrong.Passing a string worked fine but this doesn't help me because, ultimately, I need to pass an array of objects. But, passing a data object simply gives you
[object Object]
when trying to referencedata
orwindow.data
within some helper functions inside of Highchart's webview.JSON.parse(data)
should work, as well!" Doing so prevented the webview from rendering anything at all. Huh?data={JSON.stringify({ foo: "bar" })}
into<HighchartsReactNative />
and that also prevented the webview from rendering.HighchartsReactNative.js:108
to no avail.Finally, I asked myself "What gives?", and submitted this issue.
The text was updated successfully, but these errors were encountered: