jossmac / jossmac/react-images

Using HeaderClose in custom header component not working

Open
#344 0 comments 2 reactions 1 assignee Claimed by @davwheat View on GitHub
bug
Dominant language
JavaScript
Stars
2.3k
Forks
433
PR merge metrics
No merged PRs in 30d

Description

**Steps to reproduce the behavior:**
Extract the component via props.components.HeaderClose. Use in new functional component (i.e. CustomHeader ). Set the header component of the Carousel
``.

Code Example:
This does not work
```
const CustomHeader = props => {
const {
components,
modalProps,
currentView,
} = props;
const { HeaderClose } = components;
const { onClose } = modalProps;
return (


{currentView.title}


Close Here



);
};
```

This does work
```
const CustomFooter = props => {
const { currentView, components } = props;
const { Count } = components;
return (


{currentView.description}





);
};
```

**Expected behavior:**
The HeaderClose button should appear in the custom header and work to enable closing of the modal.

**Actual behavior:**

> Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.