Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Transition without a navigator #7

@dested

Description

@dested

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>
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions