File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ type OnAfter = (Info, any) => void
97
97
export type Props = {
98
98
error ?: ?any ,
99
99
isLoading ?: ?boolean ,
100
- OnBefore ?: OnBefore ,
101
- OnAfter ?: OnAfter
100
+ onBefore ?: OnBefore ,
101
+ onAfter ?: OnAfter
102
102
}
103
103
104
104
export type GenericComponent < Props > =
Original file line number Diff line number Diff line change @@ -170,15 +170,14 @@ export default function universal<Props: Props>(
170
170
) {
171
171
const { Component, error } = state
172
172
173
- if ( Component && state . error ) {
173
+ if ( Component && ! error ) {
174
174
hoist ( UniversalComponent , Component , { preload : true } )
175
- }
176
175
177
- if (Component && ! error && typeof this . props . onAfter === 'function ') {
178
- const onAfter = this . props . onAfter
179
- const info = { isMount, isSync, isServer }
180
- this . setState ( state , ( ) => onAfter ( info , Component ) )
181
- return
176
+ if ( this . props . onAfter === 'function' ) {
177
+ const { onAfter } = this.props
178
+ const info = { isMount , isSync , isServer }
179
+ onAfter(info, Component)
180
+ }
182
181
}
183
182
184
183
this . setState ( state )
You can’t perform that action at this time.
0 commit comments