Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- `Input`: Remove wrong recommendation - usage of role="search" #28168 @kolaps33 ([#28168](https://github.com/microsoft/fluentui/pull/28168))

### Fixes
- Do not use `defaultProps` in `EventListener` to avoid deprecation warnings. @layershifter ([#28725](https://github.com/microsoft/fluentui/pull/28725))
- `Datepicker`: add onCalendarOpenStateChange prop. @jurokapsiar ([#28136](https://github.com/microsoft/fluentui/pull/28136))
- Outline color now respects OS force colors settings. @george-cz ([#28182](https://github.com/microsoft/fluentui/pull/28182))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { useEventListener } from './useEventListener';
import { EventListenerOptions, EventTypes } from './types';

export function EventListener<T extends EventTypes>(props: EventListenerOptions<T>) {
useEventListener(props);
export function EventListener<T extends EventTypes>({
listener,
type,
capture = false,
targetRef,
target,
}: EventListenerOptions<T>) {
useEventListener({ listener, type, capture, targetRef, target });

return null;
}

EventListener.defaultProps = {
capture: false,
};