Commit 0d1313ac authored by Shen Chang's avatar Shen Chang

fix(Fix include and exclude):

parent 656db95d
......@@ -17,10 +17,10 @@ export default function getKeepAlive(
name: string,
include?: Pattern,
exclude?: Pattern,
keepAlive?: boolean
disabled?: boolean
) {
if (keepAlive !== undefined) {
return keepAlive;
if (disabled !== undefined) {
return !disabled;
}
if (
(include && (!name || !matches(include, name))) ||
......
......@@ -437,7 +437,7 @@ export default function keepAliveDecorator<P = any>(Component: React.ComponentTy
warn('[React Keep Alive] <KeepAlive> components must have key.');
return null;
}
const newKeepAlive = getKeepAlive(propKey, include, exclude, !disabled);
const newKeepAlive = getKeepAlive(propKey, include, exclude, disabled);
this.combinedKeepAlive = getLifecycle === undefined || getLifecycle() === LIFECYCLE.UPDATING
? newKeepAlive
: identification
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment