Inferno loses force
param when forceUpdate
is called inside the updating cycle or there are any pending updates in QUEUE
#1534
Labels
Observed Behaviour
Inferno loses
force
param whenforceUpdate
is called inside the updating cycle (whenrenderCheck.v
is set totrue
) or there are any components inQUEUE
https://github.com/infernojs/inferno/blob/master/packages/inferno/src/core/component.ts#L31-L40
So it means that
shouldComponentUpdate
for the component will be executed ifforceUpdate
is called incomponentDidUpdate
func or when there are any components get intoQUEUE
list. At the time if we wrapforceUpadate
call insidesetTimeout
everything would be okay (so SCU won't be called).It leads to unpredictable behavior, as the method works differently in different situations.
Repro
A simple example with PureComponent and render prop:
Repo: https://github.com/xnimorz/inferno-exp
Code sandbox: https://codesandbox.io/s/quirky-lake-erclr (try to click different buttons. The first button doesn't work as it was designed)
If needed I can extend the example.
Also, the original issue I got when I tried to call
recomputeGridSize
for my lists using https://github.com/bvaughn/react-virtualizedExpected Current Behaviour
Inferno should remember about
force
param so that components can be updated in a proper way.The text was updated successfully, but these errors were encountered: