Skip to content

Commit

Permalink
add in disableAnimation option to configprovider (issue ant-design#16943
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Satloff committed Dec 12, 2019
1 parent a90e447 commit 4965920
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/config-provider/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ConfigConsumerProps {
pageHeader?: {
ghost: boolean;
};
disableAnimation?: boolean;
}

export const ConfigContext = createReactContext<ConfigConsumerProps>({
Expand Down
7 changes: 7 additions & 0 deletions components/config-provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const configConsumerProps = [
'autoInsertSpaceInButton',
'locale',
'pageHeader',
'disableAnimation',
];

export interface ConfigProviderProps {
Expand All @@ -32,6 +33,7 @@ export interface ConfigProviderProps {
pageHeader?: {
ghost: boolean;
};
disableAnimation?: boolean;
}

class ConfigProvider extends React.Component<ConfigProviderProps> {
Expand All @@ -52,6 +54,7 @@ class ConfigProvider extends React.Component<ConfigProviderProps> {
autoInsertSpaceInButton,
locale,
pageHeader,
disableAnimation,
} = this.props;

const config: ConfigConsumerProps = {
Expand All @@ -73,6 +76,10 @@ class ConfigProvider extends React.Component<ConfigProviderProps> {
config.pageHeader = pageHeader;
}

if (disableAnimation) {
config.disableAnimation = disableAnimation;
}

return (
<ConfigContext.Provider value={config}>
<LocaleProvider locale={locale || legacyLocale} _ANT_MARK__={ANT_MARK}>
Expand Down

0 comments on commit 4965920

Please sign in to comment.