1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-12-11 17:57:29 +03:00

Tidy some types

This commit is contained in:
Michael Telatynski
2021-09-14 14:41:55 +01:00
parent 5048e41e8b
commit f59baf1efb
2 changed files with 11 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ const defaultMapper: Mapper<RoomState> = (roomState: RoomState) => roomState;
// Hook to simplify watching Matrix Room state
export const useRoomState = <T extends any = RoomState>(
room: Room,
room?: Room,
mapper: Mapper<T> = defaultMapper as Mapper<T>,
): T => {
const [value, setValue] = useState<T>(room ? mapper(room.currentState) : undefined);