Skip to content

Commit c67f0e7

Browse files
author
Slapbox
authored
Determine where children belong using .displayName
This fixes a sub-issue raised within mmazzarolo#141: mmazzarolo#141 (comment)
1 parent 0df53e3 commit c67f0e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/Container.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ const DialogContainer: React.FC<DialogContainerProps> = (props) => {
6262
const { styles } = useTheme(buildStyles);
6363
React.Children.forEach(children, (child) => {
6464
if (typeof child === "object" && child !== null && "type" in child) {
65-
switch (child.type) {
66-
case DialogTitle:
65+
switch (child.type.displayName) {
66+
case DialogTitle.displayName:
6767
titleChildrens.push(child as TitleElement);
6868
return;
69-
case DialogDescription:
69+
case DialogDescription.displayName:
7070
descriptionChildrens.push(child as DescriptionElement);
7171
return;
72-
case DialogButton:
72+
case DialogButton.displayName:
7373
if (Platform.OS === "ios" && buttonChildrens.length > 0) {
7474
buttonChildrens.push(
7575
<View

0 commit comments

Comments
 (0)