Comments (2)
Hey, the example code you provided needs to be wrapped in forwardRef
. Let me know if it helps.
const Button = forwardRef((props,ref) => {
const { containerStyle, theme, ...rest } = props;
const buttonStyles = styles(containerStyle);
const fetchedStyle = buttonColors(props);
const { titleStyle, icon, ...buttonStyle } = fetchedStyle;
return <LibraryButton ref={ref} icon={icon} {...rest} {...buttonStyles} buttonStyle={buttonStyle} titleStyle={titleStyle} />;
});
export default withTheme(Button);
from react-native-elements.
Hey, the example code you provided needs to be wrapped in
forwardRef
. Let me know if it helps.const Button = forwardRef((props,ref) => { const { containerStyle, theme, ...rest } = props; const buttonStyles = styles(containerStyle); const fetchedStyle = buttonColors(props); const { titleStyle, icon, ...buttonStyle } = fetchedStyle; return <LibraryButton ref={ref} icon={icon} {...rest} {...buttonStyles} buttonStyle={buttonStyle} titleStyle={titleStyle} />; }); export default withTheme(Button);
@arpitBhalla Thanks for reply but We have already tried this solution but it did not work. It is working fine if We are importing Button Component from 'react-native'. It is not working if We are importing Button component from '@rneui/base'.
Kindly help on it.
from react-native-elements.
Related Issues (20)
- TabView won't render on the BottomSheet HOT 2
- Theming is not working HOT 5
- Typescript not recognising custom theme properties HOT 3
- In webstorm, Button in @rneui/themed don't have smart tips
- React Native CLI invalid documentation link
- FAB when rendered on web Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>. HOT 4
- import { styled } from '@rneui/themed' doesn't work HOT 2
- Feature Request - Animated Shrink Button with Loading Indicator
- Avatar ignoring resize mode on initial load HOT 18
- ButtonGroup fails on iOS Expo Dev Client HOT 1
- Feature request - Circular progress component
- The documentation sidebar is not taking the correct height on mobile screens.
- The search glass is not available in Chrome browser
- Dialog.Title does not honor Dark mode text color HOT 3
- SpeedDial cant work in web platform,cuz ``` [...new Array(React.Children.count(children))]``` will returned ```[empty × 2]``` HOT 2
- NPM version missmatch for @rneui/themed's peerDeps/devDeps HOT 1
- Unable to import styled helper HOT 1
- Upgrade Expo version for Expo demo HOT 1
- [Feature Request] For web renders, let `Icon` and `Chip` render as `<button>` only if it needs to be clickable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-elements.