Comments (5)
Hello, this project is vanilla, there's no way preventing you from using it in any framework.
from webgl-fluid.
- It's a common error in SSR project, you should make sure to load the library when
window
is avaliable. - Only minimal reproduction is acceptable, you should make sure it's not caused by your own codes, thanks.
from webgl-fluid.
when using it in this code , this is nextjs alone without react three fiber
import React from "react";
import WebGLFluid from "webgl-fluid";
const index = () => {
WebGLFluid(document.querySelector("canvas"), {
// options
});
return ;
};
export default index;
You can aslo see the whole code here Repository
from webgl-fluid.
It was in react but i need to use it in react-three-fiber
import { RoundedBox } from "@react-three/drei";
import { Canvas } from "@react-three/fiber";
import React, { useEffect } from "react";
import WebGLFluid from "webgl-fluid";
const App = () => {
useEffect(() => {
if (typeof window !== "undefined") {
// Your function that uses the window object goes here
WebGLFluid(document.querySelector("canvas"), {
// options
});
}
}, []);
return (
<Canvas>
<mesh></mesh>
</Canvas>
);
};
export default App;
from webgl-fluid.
-
Sorry, you confirmed that you've searched Stack Overflow, so what's the conclusion?
There are so many similar questions like https://stackoverflow.com/questions/55151041/window-is-not-defined-in-next-js-react-app. -
The reproduction should be a minimal and whole link, check https://antfu.me/posts/why-reproductions-are-required.
You may find the problem yourself while creating that.
from webgl-fluid.
Related Issues (7)
- Nuxt JS window is not defined HOT 1
- Can't get the index.html to display anything HOT 9
- how to use it in react HOT 2
- When transparent is true, a backdrop is being set HOT 2
- Persisting the hover trigger even when hovering over other elements? HOT 6
- Add support for controlling the amount of immediate splats HOT 1
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 webgl-fluid.