Skip to content

Commit 8aefb19

Browse files
authored
Update Compressible inline documentation (#2471)
* Update Compressible documentation * Change files * lowercase * More!
1 parent 67d5cf3 commit 8aefb19

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update Compressible documentation",
4+
"packageName": "@fluentui-react-native/framework",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/framework/framework/src/compressible.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { Theme } from '@fluentui-react-native/theme-types';
22
import { stagedComponent, StagedRender } from '@fluentui-react-native/use-slot';
33
import { CustomizableComponent } from '@fluentui-react-native/use-tokens';
4-
import { UseTokens } from './useTokens';
54
import { TokenSettings } from './useStyling';
5+
import { UseTokens } from './useTokens';
66

7+
/**
8+
* Utility function which can create function components that can be tree compressed (using the stagedRender pattern),
9+
* and also have customize functionality.
10+
* @param fn StagedRender function that defines your component
11+
* @param useTokens a hook function to build a set of tokens from a passed in theme as well as a cache object
12+
* @returns A tree compressed function component with the `.customize` method exposed to it
13+
*/
714
export function compressible<TProps, TTokens>(
815
fn: StagedRender<TProps>,
916
useTokens: UseTokens<TTokens>,

packages/framework/framework/src/useTokens.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TokenSettings } from './useStyling';
55

66
export { applyTokenLayers, applyPropsToTokens, customizable, patchTokens } from '@fluentui-react-native/use-tokens';
77

8+
// A hook function to build a set of tokens from a passed in theme as well as a cache object
89
export type UseTokens<TTokens> = UseTokensCore<TTokens, Theme>;
910

1011
export function buildUseTokens<TTokens>(...tokens: TokenSettings<TTokens>[]): UseTokens<TTokens> {

0 commit comments

Comments
 (0)