Giter VIP home page Giter VIP logo

Comments (6)

KurtGokhan avatar KurtGokhan commented on July 24, 2024 1

Applied the workaround in 0.15.2. This is still a bug in React side. But shouldn't be a problem in ReactUnity anymore.

from core.

Muchaszewski avatar Muchaszewski commented on July 24, 2024

The same <view> component is part of Canvas
image

from core.

KurtGokhan avatar KurtGokhan commented on July 24, 2024

Unity doesn't have a way to create objects but not place them in the scene. Ideally, we could place all newly created objects in [Offscreen], but I guess that would affect performance just by changing an object's parent. Alternative way would be to remove every object individually after canvas is destroyed, but that would also cost performance.

In an ideal case, there shouldn't be an error in the React rendering. So I don't want to implement this in a way that would affect performance much.

from core.

Thundernerd avatar Thundernerd commented on July 24, 2024

Unity doesn't have a way to create objects but not place them in the scene.

I believe you are correct in saying this, but can't you disable the objects to "fake" them not being there?

Alternative way would be to remove every object individually after canvas is destroyed, but that would also cost performance.

It might depend on how the canvas is destroyed, but if views are children of a specific canvas and you remove the canvas, I would expect it to remove the children as well, even if it would affect performance or not, because it needs to clean up after itself.

from core.

KurtGokhan avatar KurtGokhan commented on July 24, 2024

@Thundernerd Thanks for your suggestions.

Normally, when a view is created it is placed under the canvas. But in this case, an error happens before they are placed under the canvas. That is the root cause of this issue. So your second suggestion would not work.

Disabling and enabling objects can affect performance, even if it would be minor. Also objects would still be there, so I don't think that is a solution as well.

I have some plans to fix this, but haven't started working on it yet.

from core.

KurtGokhan avatar KurtGokhan commented on July 24, 2024

I misunderstood the issue first. I can see the issue after trying it again.

It may be caused by a bug in React. I reported it here: facebook/react#26518

Let's see what React devs say about it. If it doesn't get fixed in React, I will fix it with a workaround in ReactUnity.

from core.

Related Issues (20)

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.