Coder Social home page Coder Social logo

React Three Fiber about webgl-fluid HOT 5 CLOSED

cloydlau avatar cloydlau commented on June 16, 2024
React Three Fiber

from webgl-fluid.

Comments (5)

cloydlau avatar cloydlau commented on June 16, 2024 1

Hello, this project is vanilla, there's no way preventing you from using it in any framework.

from webgl-fluid.

cloydlau avatar cloydlau commented on June 16, 2024 1
  1. It's a common error in SSR project, you should make sure to load the library when window is avaliable.
  2. Only minimal reproduction is acceptable, you should make sure it's not caused by your own codes, thanks.

from webgl-fluid.

PercyMichael avatar PercyMichael commented on June 16, 2024

i am getting an error image

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.

PercyMichael avatar PercyMichael commented on June 16, 2024

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.

cloydlau avatar cloydlau commented on June 16, 2024
  1. 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.

  2. 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)

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.