Open Turtleted21 opened 2 years ago
Hi,
Allow me to share how to handle your problem. Viro version: viro-community-react-viro-2.22.1 <- NS-BOBBY-C version, the latest version still on progress so we give room to community to finish.
and under your code convert to React.PureComponent
export default class ArtItemRender extends React.PureComponent<IProps, IState>
please follow FigmentAR code in order to handle multiple Viro3DObject
Hi, I use const function not class, equivalent to React.PureComponent is React.memo? https://dmitripavlutin.com/use-react-memo-wisely/
thanks
no difference, you cannot use React.memo, what you need just convert https://github.com/ViroCommunity/figment-ar/blob/main/js/model/PortalItems.js to modern typescript. Or leave like that file if you using .js
and how to use that component as following:
as the results you should have individual component without re-render while your parent rendering. if you use memo it will re-render (my case)
In my case, i only want render the new selected item. and data coming from redux. Previously I am using React.Memo but seems useless , so i just use direct embedded render
Hi, I must load 6 times the same glb model, so I have 1 source and I add dynamically 6 times the same Viro3Dobject, but only the first model is loaded. Sometimes this bug appear only the first time react use viro, the second time, all models are loaded, Bug appear only on android release, not in debug (tested on galaxy tab S5 , S7 ipad pro, ipad mini)
it's a old bug https://github.com/viromedia/viro/issues/699 but still here with ViroCommunity v2.21.0 possible fix : duplicate the source for each Viro3Dobject
Thanks