import type { FC } from '../../lib/teact/teact'; import React from '../../lib/teact/teact'; import { withGlobal } from '../../global'; type OwnProps = { parentRand: number; }; type StateProps = { globalRand: number; }; const ErrorTest: FC = ({ parentRand, globalRand }) => { // eslint-disable-next-line no-console console.log('rendering `ErrorTest`'); if (!parentRand || parentRand > 0.8) { throw new Error('test error render'); } return (

THIS IS `ErrorTest` Component

parent: {parentRand}
global: {globalRand}
); }; let firstRender = true; export default withGlobal((): StateProps => { const globalRand = Math.random(); if (firstRender || globalRand > 0.8) { firstRender = false; throw new Error('test error `mapStateToProps`'); } return { globalRand }; })(ErrorTest);