Version: 3.0.0-next.40

Toast

In v3 Toast can be created using useToast hook

Overview#

Migrating Toast components can broadly described in these points:

  • buttonText, type is no longer supported.

Code Comparison#

import React, { Component } from 'react';
import { Container, Header, Content, Toast, Button, Text } from 'native-base';
export default class ToastExample extends Component {
render() {
return (
<Container>
<Header />
<Content padder>
<Button
onPress={() =>
Toast.show({
text: 'Wrong password!',
})
}
>
<Text>Toast</Text>
</Button>
</Content>
</Container>
);
}
}