Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Support to trigger React Native's "LayoutAnimation.configureNext(*)" before re-rendering. #332

Closed
garrettmac opened this issue Sep 24, 2017 · 4 comments

Comments

@garrettmac
Copy link

garrettmac commented Sep 24, 2017

React Native has an easy way to trigger animation by adding LayoutAnimation.configureNext(*) before calling setState.

Example:

    LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
    this.setState({index});

Is it possible to trigger the LayoutAnimation without forking? or even the ability to inject a function to be triggered before mobx re-renders?


Resources:

LayoutAnimation blog post https://medium.com/@Jpoliachik/react-native-s-layoutanimation-is-awesome-4a4d317afd3e

LayoutAnimation source - https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/Libraries/LayoutAnimation/LayoutAnimation.js

@urugator
Copy link
Contributor

urugator commented Sep 25, 2017

ability to inject a function to be triggered before mobx re-renders?

Is componentWillReact usable?

@mweststrate
Copy link
Member

Closing for inactivity / provided answer

@phumaster
Copy link

plz, open this issue.

@mweststrate mweststrate reopened this Nov 30, 2017
@phumaster
Copy link

phumaster commented Nov 30, 2017

Oops. Sorry, I tried:

componentWillReact() {
        LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
    }

It's work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants