Giter Site home page Giter Site logo

Comments (7)

nwesthoff avatar nwesthoff commented on June 27, 2024 2

Hey @mkosir, I'm having the same issue (with Next.js), so I've taken the liberty to jump in on this issue. I'm not 100% sure whether this is an SSR issue, but I wasn't able to reproduce with plain React and setInterval() to conditionally unload it.

🐛 Issue/Bug Report Template

Describe the bug
Getting console error:

Uncaught TypeError: Cannot read property 'style' of null
    at i.resetWrapperElTransform (react-parallax-tilt.es5.js?6058:1)
    at e.renderFrame (react-parallax-tilt.es5.js?6058:1)

To Reproduce
Steps to reproduce the behavior:

  1. Conditionally use Tilt component
  2. Unload <Tilt> components it client-side (like in useEffect)
  3. Refresh page

Expected behavior
Not throw an error when using react-parallax-tilt dynamically (in a server side rendered environment)

Link to demo (required)
CodeSandbox

Code snippets
Conditionally rendering as such. Loaded is triggered in useEffect.

{loaded ? null : (
        <Tilt>
          <div>
            <h1>React Parallax Tilt</h1>
          </div>
        </Tilt>
      )}

Environment

  • OS: MacOS Big Sur
  • Browser: Chrome 88.0.4324.182
  • Version: "react-parallax-tilt": 1.4.89 (latest)

Hope this helps @WaqqarSuleman as well :)

from react-parallax-tilt.

nwesthoff avatar nwesthoff commented on June 27, 2024 1

Seems like that does resolve it for me :)

Forked Sandbox

from react-parallax-tilt.

WaqqarSuleman avatar WaqqarSuleman commented on June 27, 2024 1

Great, thx @nwesthoff
@WaqqarSuleman can you check if the latest release 1.4.90 is also working for you as expected?

@mkosir The latest version is working as expected. Thanks!

from react-parallax-tilt.

mkosir avatar mkosir commented on June 27, 2024

Hi @WaqqarSuleman thanks for the issue report, can you please fill out the issue template (library version you are using, demo link).

from react-parallax-tilt.

WaqqarSuleman avatar WaqqarSuleman commented on June 27, 2024

Hey @mkosir, I'm having the same issue (with Next.js), so I've taken the liberty to jump in on this issue. I'm not 100% sure whether this is an SSR issue, but I wasn't able to reproduce with plain React and setInterval() to conditionally unload it.

🐛 Issue/Bug Report Template

Describe the bug
Getting console error:

Uncaught TypeError: Cannot read property 'style' of null
    at i.resetWrapperElTransform (react-parallax-tilt.es5.js?6058:1)
    at e.renderFrame (react-parallax-tilt.es5.js?6058:1)

To Reproduce
Steps to reproduce the behavior:

  1. Conditionally use Tilt component
  2. Unload <Tilt> components it client-side (like in useEffect)
  3. Refresh page

Expected behavior
Not throw an error when using react-parallax-tilt dynamically (in a server side rendered environment)

Link to demo (required)
CodeSandbox

Code snippets
Conditionally rendering as such. Loaded is triggered in useEffect.

{loaded ? null : (
        <Tilt>
          <div>
            <h1>React Parallax Tilt</h1>
          </div>
        </Tilt>
      )}

Environment

  • OS: MacOS Big Sur
  • Browser: Chrome 88.0.4324.182
  • Version: "react-parallax-tilt": 1.4.89 (latest)

Hope this helps @WaqqarSuleman as well :)

Thanks a lot for demonstrating this issue. I am using the library with plain React(so no SSR). Still facing the aforementioned issue. Hope it gets resolved soon.

from react-parallax-tilt.

mkosir avatar mkosir commented on June 27, 2024

Hi @nwesthoff, thanks for providing detailed bug report with reproducible demo link!
This issue is a little harder to pinpoint but for a start I reverted some changes that were made for reducing npm package size, can you try out the newest version 1.4.90?

from react-parallax-tilt.

mkosir avatar mkosir commented on June 27, 2024

Great, thx @nwesthoff
@WaqqarSuleman can you check if the latest release 1.4.90 is also working for you as expected?

from react-parallax-tilt.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.