Comments (7)
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:
- Conditionally use Tilt component
- Unload
<Tilt>
components it client-side (like inuseEffect
) - 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.
Seems like that does resolve it for me :)
from react-parallax-tilt.
Great, thx @nwesthoff
@WaqqarSuleman can you check if the latest release1.4.90
is also working for you as expected?
@mkosir The latest version is working as expected. Thanks!
from react-parallax-tilt.
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.
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:
- Conditionally use Tilt component
- Unload
<Tilt>
components it client-side (like inuseEffect
)- Refresh page
Expected behavior
Not throw an error when using react-parallax-tilt dynamically (in a server side rendered environment)Link to demo (required)
CodeSandboxCode snippets
Conditionally rendering as such. Loaded is triggered inuseEffect
.{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.
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.
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)
- Only one Tilt works at a time HOT 2
- gyroscope not working on safari HOT 2
- Don't log Device Orientation as an error HOT 3
- Custom transitionSpeed value cancelled after certain time or mousevents HOT 2
- Glare prevents clicks HOT 2
- glareReverse not working HOT 2
- Glare on rectangle shape HOT 2
- Component dropping effects after animating in HOT 7
- Doesn't support rounded edges (or other glare props) HOT 6
- Full page listening? HOT 1
- If the functional component re-render it takes random position HOT 2
- Missing type declarations HOT 2
- How do I make initial position is tilted to signal affordance? HOT 3
- Unable to use on node v17/v18 HOT 2
- Uncaught runtime errors HOT 2
- Tilt causes crash in Next.js HOT 3
- Initial tilt doesn't work (tilts to a random XY on refresh) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-parallax-tilt.