Skip to content

Commit

Permalink
fix(next): fix config provider prefix bug (#2000) (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grapedge authored Aug 12, 2021
1 parent c5c3085 commit 32746f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/src/__builtins__/hooks/usePrefixCls.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { ConfigProvider } from '@alifd/next'

export const usePrefixCls = (
tag?: string,
props?: {
prefix?: string
}
) => {
return props?.prefix ? props?.prefix : `next${tag ? `-${tag}` : ''}`
const getContext = ConfigProvider['getContext']
return props?.prefix ?? getContext()?.prefix ?? `next${tag ? `-${tag}` : ''}`
}

0 comments on commit 32746f7

Please sign in to comment.