| 8 | }; |
| 9 | |
| 10 | export default class PortalConsumer extends React.Component<Props> { |
| 11 | componentDidMount() { |
| 12 | this.checkManager(); |
| 13 | |
| 14 | this.key = this.props.manager.mount(this.props.children); |
| 15 | } |
| 16 | |
| 17 | componentDidUpdate() { |
| 18 | this.checkManager(); |
| 19 | |
| 20 | this.props.manager.update(this.key, this.props.children); |
| 21 | } |
| 22 | |
| 23 | componentWillUnmount() { |
| 24 | this.checkManager(); |
| 25 | |
| 26 | this.props.manager.unmount(this.key); |
| 27 | } |
| 28 | |
| 29 | private key: any; |
| 30 | |
| 31 | private checkManager() { |
| 32 | if (!this.props.manager) { |
| 33 | throw new Error( |
| 34 | 'Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n' + |
| 35 | "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + |
| 36 | 'https://callstack.github.io/react-native-paper/docs/guides/getting-started' |
| 37 | ); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | render() { |
| 42 | return null; |
| 43 | } |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…