Skip to content

Commit 30a7f5a

Browse files
authored
Incubator.Dialog - remove header's renderContent (#2293)
* Incubator.Dialog - remove header's renderContent * Fix API
1 parent 13a8c99 commit 30a7f5a

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/incubator/Dialog/DialogHeader.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const DialogHeader = (props: DialogHeaderProps = {}) => {
1616
subtitle,
1717
subtitleStyle,
1818
subtitleProps,
19-
renderContent,
2019
showKnob = true,
2120
showDivider = true,
2221
leadingAccessory,
@@ -35,10 +34,6 @@ const DialogHeader = (props: DialogHeaderProps = {}) => {
3534
}, [showKnob]);
3635

3736
const headerContent = useMemo(() => {
38-
if (renderContent) {
39-
return renderContent(props);
40-
}
41-
4237
const Container = onPress ? TouchableOpacity : View;
4338
if (!isEmpty(title) || !isEmpty(subtitle)) {
4439
return (
@@ -58,8 +53,7 @@ const DialogHeader = (props: DialogHeaderProps = {}) => {
5853
}
5954

6055
return null;
61-
// eslint-disable-next-line react-hooks/exhaustive-deps
62-
}, [renderContent, title, titleStyle, titleProps, subtitle, subtitleStyle, subtitleProps]);
56+
}, [title, titleStyle, titleProps, subtitle, subtitleStyle, subtitleProps, onPress]);
6357

6458
const content = useMemo(() => {
6559
if (headerContent || leadingAccessory || trailingAccessory) {

src/incubator/Dialog/dialogHeader.api.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
{"name": "subtitle", "type": "string", "description": "Subtitle"},
1010
{"name": "subtitleStyle", "type": "StyleProp<TextStyle>", "description": "Subtitle text style"},
1111
{"name": "subtitleProps", "type": "TextProps", "description": "Subtitle extra props"},
12-
{
13-
"name": "renderContent",
14-
"type": "(props: DialogHeaderProps) => React.ReactElement",
15-
"description": "Replace the header's default content (Dialog.Text)"
16-
},
1712
{"name": "showKnob", "type": "boolean", "description": "Show the header's knob", "default": "true"},
1813
{"name": "showDivider", "type": "boolean", "description": "Show the header's divider", "default": "true"},
1914
{"name": "leadingAccessory", "type": "ReactElement", "description": "Pass to render a leading element"},

src/incubator/Dialog/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ export interface DialogHeaderProps extends ViewProps {
3434
* Subtitle extra props
3535
*/
3636
subtitleProps?: TextProps;
37-
/**
38-
* Replace the header's default content (Dialog.Text)
39-
*/
40-
renderContent?: (props: DialogHeaderProps) => React.ReactElement;
4137
/**
4238
* Show the header's knob (default is true)
4339
*/

0 commit comments

Comments
 (0)