raveclassic / frp-ts

Functional reactive values-over-time
MIT License
80 stars 8 forks source link

fix(react): fix race condition in usePropertyFromProp #50

Closed raveclassic closed 2 years ago

raveclassic commented 2 years ago

This PR fixed race condition in usePropertyFromProp caused by useLayoutEffect which was called before useEffect in useProperty. Essentially, useLayoutEffect was called between emission of new value and subscription within a conditionally rendered child. To fix this, useLayoutEffect has been replaced with useEffect. ~To fix this, useEffect in useProperty has been replaced with synchronous logic based on useRefs~

nx-cloud[bot] commented 2 years ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 6ae02a490685a6e3a299b4dad24bc6b73574ebe3. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 3 targets - [`nx affected --target=test --parallel --max-parallel=2`](https://nx.app/runs/CxZoXowoTLB) - [`nx affected --target=lint --parallel --max-parallel=3`](https://nx.app/runs/wWCGSWZf5hK) - [`nx affected --target=build --parallel --max-parallel=3`](https://nx.app/runs/DjZNjLbO4Wu)

Sent with 💌 from NxCloud.