Last active
May 16, 2022 19:49
-
-
Save fakenickels/05c819cd00520a7cabc4b3968659c0eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ReMotionConfig = { | |
type state = | Open | Closed; | |
let animateForState = fun | Open => [opacity(1)] | Closed => [opacity(0)]; | |
}; | |
module Motion = ReMotion.Make(ReMotionConfig); | |
<Motion state=Closed> | |
...(({ style, setState, state, transitioning }) => { | |
<Modal visible=(switch(state, transitioning) => { (Closed, false) => false | _ => true }) onRequestClose=(() => setState(Closed))> | |
<Animated.View style=Style.combine(Styles.wrapper, style)> | |
<Animated.View> | |
</Modal> | |
}) | |
</Motion> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment