Closed nguyen1998pr closed 11 months ago
Hi. The instance type is defined like this:
const ReactPhotoSphereViewer: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>
Where Props is a ViewerConfig extender type that is exported from the library.
export interface Props extends ViewerConfig {
src: string;
navbar?: boolean | string | Array<string | NavbarCustomButton>;
height: string;
width?: string;
containerClass?: string;
littlePlanet?: boolean;
fishEye?: boolean | number;
lang?: {
zoom: string;
zoomOut: string;
zoomIn: string;
moveUp: string;
moveDown: string;
moveLeft: string;
moveRight: string;
download: string;
fullscreen: string;
menu: string;
close: string;
twoFingers: string;
ctrlZoom: string;
loadError: string;
[K: string]: string;
};
// Events
onPositionChange?(lat: number, lng: number, instance: Viewer): void;
onZoomChange?(data: events.ZoomUpdatedEvent & { type: "zoom-updated"; }, instance: Viewer): void;
onClick?(data: events.ClickEvent & { type: "click"; }, instance: Viewer): void;
onDblclick?(data: events.ClickEvent & { type: "dblclick"; }, instance: Viewer): void;
onReady?(instance: Viewer): void;
}
Let me know if it works
I tried this but can't find the "zoom" method
In Readme: https://github.com/Elius94/react-photo-sphere-viewer#methods
I think it's a bug in the typescript. I probably need to declare the methods explicitly, because passing from a forwardRef doesn't seem to pass them automatically. In addition these methods are useImperativeHandle
. If you want you can try to fix it by contributing to the project and once it works you can PR me. Otherwise as soon as I can I will look at it, but not before Monday.
hi Elius94, do you have any update for this issue?
Hi @nguyen1998pr unfortunately I have been very busy these days, I still have to look at it! if you want you can give me a hand and contribute! anyway as soon as I have time I will look at it!
Hello! With the new release of yesterday it should'nt happen anymore. can you test it?
Hi i was following the Readme and got the error when trying to use createRef. The error description is shown in the image below:
How to fix that?