Comments (6)
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.
The same <view>
component is part of Canvas
from core.
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.
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.
@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.
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)
- Consider supporting 2023.2.0f1 HOT 1
- How get react global value from c#? HOT 4
- When transform rotating an element via css, it rotates counter clockwise, not clockwise
- souce on image element gives a Typescript error HOT 3
- TS2339: Property 'scroll' does not exist on type 'JSX.IntrinsicElements' HOT 1
- onMouseDown, onPointerDown and probably more events do not work as intended HOT 5
- Auto-Reload after changes in code are not reflected or automaticaly updated. HOT 1
- Created canvases should inherit properties from the main canvas HOT 1
- What's the best practice to use Router? HOT 2
- Chinese didn't render in ReactUnity canvas HOT 2
- Inconsistent element rendering HOT 4
- [CSS] "width: 100%" seems to not work inside of Unity HOT 1
- compare with react-unity-webgl HOT 1
- TypeScript is missing the definition of `direction` prop in `scroll` element HOT 1
- UI Toolkit renderer is missing css properties like `background-size` HOT 2
- BUG [TypeScript] `UnityEngine.Networking` has no exported member `UnityWebRequest` HOT 1
- Hot reloading? HOT 3
- Websockets? HOT 4
- [BUG] UI Toolkit `:active` does not work HOT 2
- [BUG] `decodeURIComponent` does not work in Android 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 core.