Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with React/Next #445

Open
LouisSyfer opened this issue May 7, 2024 · 0 comments
Open

Not working with React/Next #445

LouisSyfer opened this issue May 7, 2024 · 0 comments

Comments

@LouisSyfer
Copy link

LouisSyfer commented May 7, 2024

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 (


<main className={isDesktopOrLaptop && styles.main || !isDesktopOrLaptop && 'col-12'}>
<div className={isDesktopOrLaptop && styles.postCard || !isDesktopOrLaptop && 'col-12'}>
{urlImg && props.gallery_post === undefined && props.three_sixty_posts === "img360" ? (

) : null}

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

        </div>
  </main>
</div>

);
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant