Skip to content

feat: add SpringContext component #824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aleclarson opened this issue Oct 4, 2019 · 2 comments
Closed

feat: add SpringContext component #824

aleclarson opened this issue Oct 4, 2019 · 2 comments
Labels
kind: request New feature or request that should be actioned

Comments

@aleclarson
Copy link
Contributor

aleclarson commented Oct 4, 2019

🚀 Feature Proposal

Add a SpringContext component that can pause, cancel, or finish any animation within its child components.

// Every react-spring animation inside "Home" is affected.
const App = () => (
	<SpringContext pause={true} cancel={true} immediate={true}>
		<Home />
	</SpringContext>
)

You can nest SpringContext components to override props for a subtree.

Motivation

Provide an easy way to reduce CPU cycles by pausing animations when they're not visible.

@aleclarson aleclarson added the kind: request New feature or request that should be actioned label Oct 4, 2019
@aleclarson
Copy link
Contributor Author

The immediate prop works well with #811 (comment)

@ShanonJackson
Copy link

Don't feel like this is neccessary; you can already achieve this yourself through providing your own context + listening for that context in component's that useSpring and setting immediate/cancel/paused etc.

If you want it natively (I.E Inbuilt context listeners) then just extend animated.div yourself

@aleclarson aleclarson changed the title feat: add Animation component feat: add SpringContext component May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: request New feature or request that should be actioned
Projects
None yet
Development

No branches or pull requests

2 participants