jossmac / jossmac/react-images
Using HeaderClose in custom header component not working
- 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 (
Close Here
);
};
```
This does work
```
const CustomFooter = props => {
const { currentView, components } = props;
const { Count } = components;
return (
);
};
```
**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
Assessment
This issue has not been assessed yet.