react-native-paper
Version:
Material design for React Native
24 lines • 873 B
JavaScript
import * as React from 'react';
export default class PortalConsumer extends React.Component {
componentDidMount() {
this.checkManager();
this.key = this.props.manager.mount(this.props.children);
}
componentDidUpdate() {
this.checkManager();
this.props.manager.update(this.key, this.props.children);
}
componentWillUnmount() {
this.checkManager();
this.props.manager.unmount(this.key);
}
checkManager() {
if (!this.props.manager) {
throw new Error('Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n' + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + 'https://callstack.github.io/react-native-paper/docs/guides/getting-started');
}
}
render() {
return null;
}
}
//# sourceMappingURL=PortalConsumer.js.map