Skip to content

Commit 56fde30

Browse files
authored
Modifiers - expose extractAccessibilityProps & extractComponentProps (#1043)
* Modifiers - expose extractAccessibilityProps & extractComponentProps * Import from commons and not commons/new * Export the whole Modifiers file
1 parent 4869105 commit 56fde30

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

generatedTypes/commons/modifiers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export declare function extractModifierProps(props: Dictionary<any>): _.Dictiona
9393
* @deprecated switch to Modifiers#extractComponentProps
9494
*/
9595
export declare function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]): Pick<Partial<Dictionary<any>>, number>;
96-
export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps: string[]): Pick<Partial<Dictionary<any>>, number>;
96+
export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps?: string[]): Pick<Partial<Dictionary<any>>, number>;
9797
export declare function getThemeProps(props?: any, context?: any): any;
9898
export declare function generateModifiersStyle(options: {
9999
color: boolean;

generatedTypes/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './style';
77
export * from './services';
88
export * as Incubator from './incubator';
99
export * as Hooks from './hooks';
10+
export * as Modifiers from './commons/modifiers';
1011
export {
1112
asBaseComponent,
1213
withScrollEnabler,

src/commons/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ module.exports = {
2727
},
2828
get withScrollReached() {
2929
return require('./withScrollReached').default;
30+
},
31+
get modifiers() {
32+
return require('./modifiers');
3033
}
3134
};

src/commons/modifiers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]) {
319319
return ownProps;
320320
}
321321

322-
export function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps: string[]) {
322+
export function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps: string[] = []) {
323323
const componentPropTypes = component.propTypes;
324324
const componentProps = _.chain(props)
325325
.pickBy((_value, key) => _.includes(Object.keys(componentPropTypes), key))

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ export default {
226226
get withScrollReached() {
227227
return require('./commons').withScrollReached;
228228
},
229+
get Modifiers() {
230+
return require('./commons').modifiers;
231+
},
229232

230233
// Helpers
231234
get AvatarHelper() {

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export {
1818
} from './commons/new';
1919
export * as Incubator from './incubator';
2020
export * as Hooks from './hooks';
21+
export * as Modifiers from './commons/modifiers';
2122
export {default as ActionBar, ActionBarProps} from './components/actionBar';
2223
export {default as Avatar, AvatarPropTypes, AvatarProps} from './components/avatar';
2324
export {default as Badge, BadgeProps} from './components/badge';

0 commit comments

Comments
 (0)