Comments (15)
How about 1.8.3
from fre.
How about 1.8.3
All versions after 1.8.1
affect that example.
Here's another simpler example:
https://codesandbox.io/s/fre-demo-uxuic
This one starts to break with version 1.8.0
already, so the bug may have been partially introduced there.
Watch:
All of a sudden, it's like the scheduler stops accepting new tasks or something?
If you look in the console, you can see event handlers are still firing - it's the calls to the useState
setters that aren't triggering updates.
Could be related to this maybe?
from fre.
This looks like 1.8.0 is wrong, in version 1.8.3 I removed []
and it worked
const component = useMemo(() => new Component(props));
from fre.
Okay, we still have missing tests for useEffect
with different deps
arguments - all the tests use an array right now. If this is the problem, I guess that's why the tests didn't catch it.
That might explain the problem with the first example.
But according to useMemo docs:
If no array is provided, a new value will be computed on every render.
That's not what I want in the first example - I'm passing []
because the function has no dependencies and should be executed only on the first render.
And the second example? The error is periodic, as you can see in the GIF - so probably has something to do with the scheduler? Might be two separate problems.
Gotta get the rest of the tests in place...
from fre.
I'm sorry, your code is correct, I just debugged it, this is indeed my fault, I will fix it as soon as possible, thanks!
from fre.
Okay, cool - I'll try to get the missing coverage for hooks today, so we can make sure this stuff doesn't break again 🙂
from fre.
It seems that I have fixed this bug, and then it should be #80
from fre.
I'm sorry, I think you misunderstood.
The test was correct - it failed because the effects weren't being triggered correctly.
Now the test is wrong: the same cleanup and effects should not execute more than once!
from fre.
Can you give me an example with sandbox? the test I am not sure weather it is correct.
from fre.
In fact, the bug here has nothing to do with useeffect, but all my debugging results are the same as react. I need an example to show the difference between react and fre, not the document or the test ,Thank you very much
from fre.
Let me explain again. I'm not sure whether the test case is correct or not, but I won't say it's wrong. I have to get an example that can be debugged, or I will maintain the status quo. If the example proves my mistake, it's not difficult to fix it, please forgive me.
from fre.
I have to get an example that can be debugged, or I will maintain the status quo.
That's what the tests are for 😉
I guess from the HTML files in the demo
folder that you're debugging from an HTML page in a browser?
When you run the tests under node
, you can connect (for example from VS Code or WebStorm, whatever you're using) to the debugger, set breakpoints, inspect variables, run individual tests with a click, and so on - it's definitely worth learning. 🙂
from fre.
With your last commit, I can confirm that my sandbox example is now working correctly!
It took me a while to figure out why the test is passing with your change - it looks wrong, but now I see the error in my test! PR on the way! 😁
from fre.
For the record, the weird problem I showed above where the scheduler seemed to die - this also no longer seems to occur, so these were probably related. 👍
from fre.
I published v1.8.5👏
from fre.
Related Issues (20)
- 该段 JSX 在首次渲染视图时可能出错 HOT 1
- Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': This node type does not support this method. HOT 2
- useState bug HOT 1
- true instead of ture HOT 3
- demo 最新的master上不能用了
- demo 最新的master上不能用了 HOT 1
- 😄 HOT 5
- 能否抽空增加源码注释 HOT 6
- Support for new React 18 hook - useSyncExternalStore HOT 2
- 请问支持ssr吗 HOT 3
- useState and useReducer dispatch unstable between renders HOT 5
- batchedUpdates? HOT 1
- When render is called multiple times HOT 3
- Funny rendering results: when rendering a list, if the expressions are not wrapped in tags alone like <div>{list.map..}</div>, may cause a funny render. HOT 2
- Support useTransition/startTransition/Suspense? HOT 1
- XiaoHeShang-NMSL HOT 1
- 渲染 10w 个节点,对比 fre、vue、react HOT 2
- 记录一些问题
- [Question] useState 为何无函数式初始化方式 HOT 5
- [Bug] useRef 莫名丢失透传参数,memo失效 HOT 2
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 fre.