Giter Site home page Giter Site logo

Comments (3)

IjzerenHein avatar IjzerenHein commented on May 12, 2024 1

Hi, in that case I would define the ‘sharedElements’ static function on the screen that you are navigation to. And then you can additionally filter on the route-name that you are coming from. Like this:

class MyAccountScreen extends Component {
  static sharedElements = (navigation, otherNavigation, showing) => {
    if ((otherNavigation.state.routeName === “Overview'” && showing) {
      return [“fullName”, “emailAddress”, “userPhoto”];
    }
  }

  ...
}

from react-navigation-shared-element.

vikrantnegi avatar vikrantnegi commented on May 12, 2024

@IjzerenHein
What if I Header component for the header with the name, email, and photo?
Can I add the SharedElement tag inside Header component that is being used in the two screens?

I'm also using StyledComponent. Here is my Header component.

<Row
  padding
  as={TouchableOpacity}
  style={{alignItems: 'center'}}
  onPress={onPress}>
  <Avatar center primary>
    <Body noMargin center white>
      VN
    </Body>
  </Avatar>
  <Block noMargin marginLeft style={{flex: 1}}>
    <Body noMargin>Vikrant Negi</Body>
    <Body noMargin regular>
      [email protected]
    </Body>
  </Block>
  <Block noMargin as={TouchableOpacity}>
    <Icon name="ios-search" size={30} />
  </Block>
</Row>

from react-navigation-shared-element.

IjzerenHein avatar IjzerenHein commented on May 12, 2024

Transitioning to and from the Header has not yet been explored yet. It probably doesn’t work, but I would like to support it in the future.

from react-navigation-shared-element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.