Skip to content

Commit

Permalink
fix: children type of chat provider
Browse files Browse the repository at this point in the history
react types upgraded
  • Loading branch information
supersnager committed Jul 12, 2022
1 parent c739208 commit 0e74498
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.5",
"@types/prop-types": "15.7.5",
"@types/react": "^17.0.3",
"@types/react": "^18.0.15",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"eslint": "^8.19.0",
Expand Down
11 changes: 6 additions & 5 deletions src/provider/ChatProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
useRef,
useState,
} from "react";
import type { ReactChild, ReactChildren } from "react";
import type { ReactNode } from "react";
import type {
ChatServiceFactory,
ChatState,
Expand Down Expand Up @@ -277,7 +277,7 @@ export interface ChatProviderProps<S extends IChatService> {
serviceFactory: ChatServiceFactory<S>;
storage: IStorage;
config: ChatProviderConfig;
children?: ReactChild | ReactChildren;
children?: ReactNode;
}

/**
Expand Down Expand Up @@ -347,9 +347,10 @@ export const ChatProvider = <S extends IChatService>({
* Get user by id
* @param userId
*/
const getUser = useCallback((userId: UserId) => storage.getUser(userId)[0], [
storage,
]);
const getUser = useCallback(
(userId: UserId) => storage.getUser(userId)[0],
[storage]
);

/**
* Set active conversation
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ __metadata:
"@semantic-release/git": ^10.0.1
"@semantic-release/github": ^8.0.5
"@types/prop-types": 15.7.5
"@types/react": ^17.0.3
"@types/react": ^18.0.15
"@typescript-eslint/eslint-plugin": ^5.30.6
"@typescript-eslint/parser": ^5.30.6
eslint: ^8.19.0
Expand Down Expand Up @@ -931,14 +931,14 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:^17.0.3":
version: 17.0.3
resolution: "@types/react@npm:17.0.3"
"@types/react@npm:^18.0.15":
version: 18.0.15
resolution: "@types/react@npm:18.0.15"
dependencies:
"@types/prop-types": "*"
"@types/scheduler": "*"
csstype: ^3.0.2
checksum: d29f2a33ed69fae9d9f42f8b39b40352e3209eb821f827d566330adfdffb48d2dc730982356cd50a7fda6171e6bc7deca793f7b105c95fce615a45ab313ecf41
checksum: e22cc388d1c145aa184787e44dc28db4789976c704cd5db475c170bb76a560eb81def5f346cfe750949bb3d43ad88822b8cbb9f19b1286e3795892a8263e7715
languageName: node
linkType: hard

Expand Down

1 comment on commit 0e74498

@chabelesther
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super ui

Please sign in to comment.