Replaces the current screen at the top of the stack
example
screen/Main/Component.tsx
```ts
import * as React from 'react';
import { replace } from '@ef-carbon/react-native-navigation';
import OtherScreen from '../OtherScreen';
export class MyScreen extends React.PureComponent {
private readonly navigateToNavigation = (): void => {
// This does type checked pushing of a new screen to the stack
replace(OtherScreen, { firstName: 'Joe', secondName: 'Bloggs' });
}
}
`
Replaces the current screen at the top of the stack
import OtherScreen from '../OtherScreen';
export class MyScreen extends React.PureComponent { private readonly navigateToNavigation = (): void => { // This does type checked pushing of a new screen to the stack replace(OtherScreen, { firstName: 'Joe', secondName: 'Bloggs' }); } }
`