Conversation
|
|
||
| //Initial frame load and settings | ||
| const iframeRef = generateIframeRef({ | ||
| const [hasInitRef, setHasInitRef] = useState(false); |
There was a problem hiding this comment.
nit: more legible when all state are up top together
| .pipe( | ||
| tap(() => { | ||
| if (isFirst) { | ||
| setHasInitRef(true); |
There was a problem hiding this comment.
can we encapsulate the fix into client-api , and leave react out of it, e.g., no g object until client-api is ready?
aucahuasi
left a comment
There was a problem hiding this comment.
Thanks! I left a comment https://github.com/graphistry/graphistry-js/pull/189/files#r2191115634
b6f10fd to
aad535f
Compare
| url, | ||
| iframeStyle, iframeClassName, iframeProps, allowFullScreen | ||
| ]); | ||
| }, []); |
There was a problem hiding this comment.
this feels a bit risky, if there's a new iframe, we need to reconnect, right?
maybe we should do something like: if (any?) params undefined (vs ''), do nothing, to avoid premature loads. Right now it's just if (iframe && dataset), which may not check enough
Maybe do a few page loads to print what's going on here?
I can imagine:
- Initial frame loads have empty params till filled out, so need to suppress
- Later loads might some reason have empty and need suppressing? unclear
No description provided.