-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from oceanbase/zhuyue-dev
fix(design): ConfigProvider should not inject StaticFunction many times by default
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
packages/design/src/config-provider/__tests__/injectStaticFunction.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { useContext } from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { ConfigProvider, useToken } from '@oceanbase/design'; | ||
import { injectedStaticFunction } from '../../static-function'; | ||
|
||
describe('ConfigProvider injectStaticFunction', () => { | ||
it('injectStaticFunction', () => { | ||
const Child = () => { | ||
expect(injectedStaticFunction).toBe(true); | ||
return <div />; | ||
}; | ||
render( | ||
<ConfigProvider> | ||
<Child /> | ||
</ConfigProvider> | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters