Skip to content

Commit

Permalink
🏷️ fix: add linters props to StyleProvider (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Jul 21, 2023
1 parent 2173271 commit 1d21bae
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/factories/createStyleProvider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import { createEmotion, Emotion } from '@/core/createEmotion';
import { StyleManager } from '@/types';
import { StyleProvider as AntdStyleProvider } from '@ant-design/cssinjs';
import { StylisPlugin } from '@emotion/cache';
import {
ComponentProps,
Context,
FC,
memo,
ReactNode,
useContext,
useEffect,
useMemo,
} from 'react';
StyleProvider as AntdStyleProvider,
StyleProviderProps as AntdStyleProviderProps,
} from '@ant-design/cssinjs';

import { StylisPlugin } from '@emotion/cache';
import { Context, FC, memo, ReactNode, useContext, useEffect, useMemo } from 'react';

export interface StyleProviderProps
extends Partial<
Pick<
ComponentProps<typeof AntdStyleProvider>,
'autoClear' | 'cache' | 'hashPriority' | 'ssrInline' | 'transformers'
AntdStyleProviderProps,
'autoClear' | 'cache' | 'hashPriority' | 'ssrInline' | 'transformers' | 'linters'
>
> {
/**
Expand Down Expand Up @@ -74,6 +69,7 @@ export const createStyleProvider = (EmotionContext: Context<Emotion>): FC<StyleP
nonce,
insertionPoint,
stylisPlugins,
linters,
...antdStyleProviderProps
}) => {
const defaultEmotion = useContext(EmotionContext);
Expand Down Expand Up @@ -113,7 +109,7 @@ export const createStyleProvider = (EmotionContext: Context<Emotion>): FC<StyleP
if (Boolean(Object.keys(antdStyleProviderProps).length) || container) {
return (
// @ts-ignore
<AntdStyleProvider container={container} {...antdStyleProviderProps}>
<AntdStyleProvider linters={linters} container={container} {...antdStyleProviderProps}>
{content}
</AntdStyleProvider>
);
Expand Down

0 comments on commit 1d21bae

Please sign in to comment.