How to use scrollToBottomComponent?
See original GitHub issueIssue Description
I’m not sure how to use scrollToBottomComponent
to customize the component with scrollToBottom={true}
.
Got the following error when trying to use this two props together:
ExceptionsManager.js:82 Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.
Steps to Reproduce / Code Snippets
private _scrollToBottomComponent(props) {
return (
<View style={styles.scrollToBottomContainer}>
<TouchableOpacity {...props}>
<Text>Image here</Text>
</TouchableOpacity>
</View>
);
}
Expected Results
To be able to center the component and change the current <Text>V</Text> to an image or possibly animation with either lottie-react-native or react-native-element.
Additional Information
- Nodejs version: 11.13.0
- React version: 16.8.3
- React Native version: 0.59.3
- react-native-gifted-chat version: 0.7.2
- Platform(s) (iOS, Android, or both?): Both
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Chat app with React Native (part 4) - A guide to create Chat UI ...
Use IconButton component from react-native-paper to customize this button. Add the prop scrollToBottomComponent to <GiftedChat /> . Add ...
Read more >Chat app with React Native (part 4): Create Chat UI Screens ...
Use the IconButton component from react-native-paper to customize this button. Add the prop scrollToBottomComponent to <GiftedChat /> . Add ...
Read more >How to add max height to my ScrollToBottom component?
I am using ScrollToBottom from the library 'react-scroll-to-bottom'. ... Have you tried to use css property max-height ...
Read more >Creating a Chat Component With React Native | by Yash Gupta
scrollToBottom}scrollToBottomComponent={this.props. ... Then, we use something called a pairing function from mathematics.
Read more >react-native-gifted-chat - npm
Start using react-native-gifted-chat in your project by running `npm i ... scrollToBottomComponent (Function) - Custom Scroll To Bottom ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found this snippet pertaining to the bottom scroll component inside the source code:
It seems
this.props.scrollToBottomComponent
should bethis.props.scrollToBottomComponent()
since the documentation states that you need to pass in a function.I also noticed that the default component is styled so that it appears on the bottom right of the screen as seen here:
If we try to do the same absolute positioning by styling our own component that is passed in then it will not achieve the same behavior. Our component is wrapped by
TouchableOpacity
whereas the default component wrapsTouchableOpacity
in a view that receives the above style.Hey guys, i found there’s no way to customize the container, I don’t want it to be a circle-shaped with opacity. How can I edit the container? in the props it says i can pass the scrollToBottomStyle, but it’s not using it anywhere within the code.