Skip to content

closeView

Function that closes the current screen. It can be used when you want to exit a service by pressing a "Close" button.

Signature

typescript
function closeView(): Promise<void>;

Return Value

  • Promise<void>

Example

Close screen with close button

tsx
import { Button } from 'react-native';
import { closeView } from '@granite-js/react-native';

function CloseButton() {
  return <Button title="Close" onPress={closeView} />;
}