itwinjs-core
itwinjs-core copied to clipboard
Error: IModelReadRpcInterface.openForRead() is not available
Error: IModelReadRpcInterface.openForRead() is not available and Error: Invalid hook call. Hooks can only be called inside of the body of a function component.

Expected behavior I think I may done some mistake in above code please check

I'm_ trying to call onIModelConnected in ViewerStartup.tsx ( by import onIModelConnected from "./App";)
But im getting the below error

The code you've shared looks fine, but I can't tell if there's an issue with the SmartDetector.tsx file.
Like the error says, invalid hook call, and it list 3 potential reasons why, please take a look at: https://reactjs.org/warnings/invalid-hook-call-warning.html.
closing this issue due to inactivity. feel free to re-open when providing more details.