We upgraded from 1.0.2
-> 1.0.7
last week and I noticed the following warning in the console in development:
instrument.js:139 Warning: Failed prop type: Invalid prop `onScroll` of type `function` supplied to `ConversationScroll`, expected `object`.
in ConversationScroll (created by ConversationPanel)
in ConversationPanel (created by Context.Consumer)
in SendbirdAwareConversationPanel (at SendbirdChatApp.tsx:34)
in Sendbird (at SendbirdChatApp.tsx:26)
in ChatApp
From digging into the sendbird-uikit
node module, I noticed the following bits of code:
propTypes
ConversationScroll.propTypes = {
// https://stackoverflow.com/a/52646941
scrollRef: PropTypes.shape({
current: PropTypes.oneOfType([PropTypes.element, PropTypes.shape({})])
}).isRequired,
hasMore: PropTypes.bool,
messagesDispatcher: PropTypes.func.isRequired,
onScroll: PropTypes.shape({
load: PropTypes.func,
hasMore: PropTypes.bool
}),
call site
React__default.createElement(ConversationScroll, {
swapParams: sdk && sdk.getErrorFirstCallback && sdk.getErrorFirstCallback(),
scrollRef: scrollRef,
hasMore: hasMore,
disabled: !isOnline,
messagesDispatcher: messagesDispatcher,
onScroll: onScrollCallback,
where onScrollCallback
is a function, not an object.
I also noticed this one this morning, although I haven’t had time to dig in yet:
instrument.js:139 Warning: Failed prop type: Invalid prop `placeholder` of type `boolean` supplied to `ForwardRef`, expected `string`.
in ForwardRef (created by ConversationPanel)
in ConversationPanel (created by Context.Consumer)
in SendbirdAwareConversationPanel (at SendbirdChatApp.tsx:34)
in Sendbird (at SendbirdChatApp.tsx:26)
in ChatApp
Not causing us any issues at the moment - the code seems to be correct, just not the propTypes - just wanted to flag the warnings. We are using TypeScript 3.9.3 FWIW.
Thanks!