Update ReactFeatures.md

This commit is contained in:
Juho Teperi 2019-10-09 11:06:54 +03:00 committed by GitHub
parent 078976de26
commit e1075a410c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ You can use `getDerivedStateFromError` (since React 16.6.0 and Reagent 0.9) (and
(let [error (r/atom nil)]
(r/create-class
{:component-did-catch (fn [this e info])
:get-derived-state-from-error-test (fn [e]
:get-derived-state-from-error (fn [e]
(reset! error e)
#js {})
:reagent-render (fn [comp]
@ -78,7 +78,7 @@ can be more obvious with the new `getDerivedStateFromError` method:
{:constructor (fn [this props]
(set! (.-state this) #js {:error nil}))
:component-did-catch (fn [this e info])
:get-derived-state-from-error-test (fn [error] #js {:error error})
:get-derived-state-from-error (fn [error] #js {:error error})
:render (fn [this]
(r/as-element
(if @error