Skip to content

Conversation

@joshuaellis
Copy link
Member

Why

resolves #1096

What

We attach our springs to the Controller in a useEffect hook however the life cycle of hooks means the setState hook is called before any useLayoutEffect or useEffect hooks are called so our SpringValues are destroyed and lost never being added to the Controller.

Instead when we create springs, we attach them to the Controller immediately preserving them.

Checklist

  • Ready to be merged

@joshuaellis joshuaellis changed the base branch from master to beta May 13, 2021 20:20
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 23f7bf6:

Sandbox Source
spring-card Configuration
spring-goo-blobs Configuration
spring-flip-card Configuration
spring-slide Configuration
spring-draggable-list Configuration
spring-cards-stack Configuration
spring-viewpager Configuration
spring-simple-transition Configuration
spring-image-fade Configuration
spring-list-reordering Configuration
tender-bogdan-9ujvk Issue #1096

@joshuaellis joshuaellis merged commit 9176c5a into beta May 15, 2021
@joshuaellis joshuaellis deleted the fix/springs-sometimes-return-undefined branch May 15, 2021 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v9.0.0-rc.3] When state is updated in render code, it causes useSpring to return undefined

2 participants