import React from 'react' ; import { FallbackProps } from './lib/ErrorBoundary' ; param error param resetErrorBoundary constructor export const ErrorFallback = ( { error , resetErrorBoundary } ) => { return ( < div role = "alert" > < p > 出错啦 < /p> < pre > { error . message } < /pre> < button onClick = { resetErrorBoundary } > Try again < /button> < /div>); } ;