naver / egjs-view360

360 integrated viewing solution
https://naver.github.io/egjs-view360/
MIT License
500 stars 90 forks source link

Not working with React/Next #445

Open LouisSyfer opened 6 months ago

LouisSyfer commented 6 months ago

This package merely does not work with Nextjs. I get a blank image.

`import React, { useState, useEffect, useMemo } from "react"; import View360, { EquirectProjection } from "@egjs/react-view360"; import "@egjs/react-view360/css/view360.min.css";

export default function SinglePost(props) {

const Viewer = () => { const projection = useMemo(() => new EquirectProjection({ src: (props.video_path && urlVid) || (props.image_path && urlImg), video: (props.video_path && true) || (props.image_path && false), }), []);

return <View360 projection={projection} className="is-16by9"/>

} return (

{urlImg && props.gallery_post === undefined && props.three_sixty_posts === "img360" ? ( ) : null} {urlVid && props.gallery_post === undefined && props.three_sixty_posts === "vid360" ? ( ) : null}
  </main>
</div>

); }`