In the change from v3.2.2 to v3.3.0 of viewer-react , a bug with the viewer was introduced. When there was a sibling component to the viewer in an viewer application, updating the state of the sibling component would cause the viewer to fully rerender. This was found to be caused by a change to the dependencies of a hook in the IModelLoader.
The change that caused the bug was changing the dependencies of the getModelConnection from checking only the iTwinId, iModelId, changeSetId, and filePath to checking all of the the viewer's props. When the parent of both the viewer and its sibling would rerender due to a change in the sibling, items like ui providers would be created again. This changed the viewer's props, causing the hook to trigger and reset the imodel connection.
update dependencies in getModelConnection hook from IModelLoader.tsx
removed viewerProps from dependencies
added viewerProps.iTwinId, viewerProps.iModelId, viewerProps.changeSetId, viewerProps.filePath to dependencies
updated deprecated method from getLocalizedStringWithNamespace to getLocalizedString
The other change was to the web-viewer-test. The history component was deprecated and replaced with the history component from "@remix-run/router".
In the change from v3.2.2 to v3.3.0 of viewer-react , a bug with the viewer was introduced. When there was a sibling component to the viewer in an viewer application, updating the state of the sibling component would cause the viewer to fully rerender. This was found to be caused by a change to the dependencies of a hook in the IModelLoader.
The change that caused the bug was changing the dependencies of the getModelConnection from checking only the iTwinId, iModelId, changeSetId, and filePath to checking all of the the viewer's props. When the parent of both the viewer and its sibling would rerender due to a change in the sibling, items like ui providers would be created again. This changed the viewer's props, causing the hook to trigger and reset the imodel connection.
getLocalizedStringWithNamespace
togetLocalizedString
The other change was to the web-viewer-test. The history component was deprecated and replaced with the history component from "@remix-run/router".