This repository was archived by the owner on Dec 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
This repository was archived by the owner on Dec 2, 2021. It is now read-only.
Transition without a navigator #7
Copy link
Copy link
Open
Description
Issue
Is it possible to use the library without any router at all? I would love to simply provide subsequent Scenes that get displayed without the use of any navigator, as in the example below. Is this a use-case you support, or even intend to support?
The library looks incredibly, I truly appreciate the work you've put into it. Keep up the good work.
I'm seeing this behaviour on
- Device: Android 9
- Routing/transition library: none
- React-native version: v58.4
- react-native-magic-move version: v0.5.0
Provide the code
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, Button } from 'react-native';
import * as MagicMove from 'react-native-magic-move';
export default class App extends Component {
state = { scene: 1 };
render() {
return (
<View style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
}}>
<Button onPress={() => this.setState({ scene: this.state.scene + 1 })} title={'next'}></Button>
<MagicMove.Provider>
{this.state.scene === 1 && <MagicMove.Scene>
<MagicMove.View id="logo" style={{
width: 100,
height: 100,
backgroundColor: "green",
borderRadius: 50
}} />
</MagicMove.Scene>}
{this.state.scene === 2 && <MagicMove.Scene>
<MagicMove.View id="logo" style={{
width: 300,
height: 300,
backgroundColor: "blue",
borderRadius: 10
}} />
</MagicMove.Scene>}
{this.state.scene === 3 && <MagicMove.Scene>
<MagicMove.View id="logo" style={{
width: 200,
height: 200,
backgroundColor: "red",
borderRadius: 50
}} />
</MagicMove.Scene>}
</MagicMove.Provider>
</View>
);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels