gre / gl-react

gl-react – React library to write and compose WebGL shaders

Home Page:https://gl-react-cookbook.surge.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

White screen after changing Surface width/height in gl-react-native

QuevedoIB opened this issue · comments

"gl-react": "^4.0.1",
"gl-react-image": "^3.1.1",
"gl-react-instagramfilters": "^0.2.0",
"gl-react-native": "^4.0.1",

Latest version of gl-react and gl-react-native.

Expected behavior

Changing Surface style (height and width) should change sizes and rerender.

Actual behavior

Surface randomly disappears after changing the sizes.

Steps to reproduce the behavior

Change state and pass different props to Surface component.

Anyone had a similar problem and has any idea of what could be the reason?

I wrote a test example in cookbook-rn "resizing" and manage to reproduce something weird. I have a slider that control the surface size, and strangely the canvas manage to properly re-render only half of the time. I wonder if it's some inner properties of Expo GLView that defer a bit the resizing and therefore empty the canvas content a bit after our redraw logic updates.

maybe i need to write the redraw logic not in a "DidUpdate" but in a "after layout" or something?

any clue @nikki93 / @sjchmiela ?

thanks

Any update on this? @gre @nikki93 @sjchmiela

I'll close this in favor of #288 because it's a more up to date version of the current situation on latest expo (it no longer resize at all)