@theorem/react
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -0,1 +1,6 @@ | ||
# 3.2.0 | ||
- ErrorBoudary: now receives componentStack | ||
- routing: links with targets are allowed | ||
# 3.1.0 | ||
@@ -2,0 +7,0 @@ |
import { Component, ComponentType, ReactNode } from "react"; | ||
declare type Props = { | ||
children: ReactNode; | ||
reportError: (error: Error) => void; | ||
reportError: (error: Error, details: { | ||
componentStack: string; | ||
}) => void; | ||
} & ({ | ||
@@ -16,3 +18,5 @@ component: ComponentType<{ | ||
}; | ||
componentDidCatch(error: Error): void; | ||
componentDidCatch(error: Error, details: { | ||
componentStack: string; | ||
}): void; | ||
componentDidMount(): void; | ||
@@ -19,0 +23,0 @@ componentWillUnmount(): void; |
@@ -26,4 +26,4 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
ErrorBoundary.prototype.componentDidCatch = function (error) { | ||
this.props.reportError(error); | ||
ErrorBoundary.prototype.componentDidCatch = function (error, details) { | ||
this.props.reportError(error, details); | ||
this.setState({ error: error }); | ||
@@ -30,0 +30,0 @@ }; |
@@ -19,2 +19,5 @@ function findLink(el) { | ||
return; | ||
var target = link.getAttribute("target"); | ||
if (target && target !== "_self") | ||
return; | ||
var url = new URL(link.href); | ||
@@ -21,0 +24,0 @@ // External links including other procols like mailto |
{ | ||
"name": "@theorem/react", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Theorem React tools", | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
46839
84
1095