re-rxjs / react-rxjs

React bindings for RxJS
https://react-rxjs.org
MIT License
549 stars 19 forks source link

Rest parameters on >0.4.3 and <0.6.1 #156

Closed ilikejames closed 3 years ago

ilikejames commented 3 years ago

This is fixed in 0.6.1 so just looking for advice on this, and whether a fix can be patched into 0.5.x Affects versions >0.4.3 <0.6.1

const [useRequiresTheArray] = bind((s: string, a: string[]) => {
  return of(a.join(s));
});

is fine, but

const [useRequiresTheArray] = bind((s: string, ...a: string[]) => {
  return of(a.join(s));
});
Warning: The final argument passed to useEffect changed size between renders. The order and size of this array must remain constant.

Example Code

voliva commented 3 years ago

Patched on 0.5.2

ilikejames commented 3 years ago

Brilliant!