You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shelendrasingh
changed the title
ref prop is not working for Button component
ref prop is not working for Button component of New React native element lib (@rneui/base & @rneui/themed)
Feb 1, 2024
@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'.
Is there an existing issue for this?
Explain what you did
ref prop is not working for Button component
`
import { withTheme } from '@rneui/themed';
import { Button as LibraryButton } from '@rneui/base';
..........
const Button = (props) => {
const { containerStyle, theme, ...rest } = props;
const buttonStyles = styles(containerStyle);
const fetchedStyle = buttonColors(props);
const { titleStyle, icon, ...buttonStyle } = fetchedStyle;
return <LibraryButton icon={icon} {...rest} {...buttonStyles} buttonStyle={buttonStyle} titleStyle={titleStyle} />;
};
....
export default withTheme(Button);
`
we are sending ref as prop in Button Component like below code.
Versions using :
"@rneui/base": "^4.0.0-rc.8",
"@rneui/themed": "^4.0.0-rc.8"
`
const submitButtonRef = React.useRef();
........
`
Expected behavior
Currently Getting: we are getting undefined for submitButtonRef?.current
Expected: we should get submitButtonRef?.current value.
Describe the bug
ref prop is not working for Button component
Steps To Reproduce
Screenshots
No response
Your Environment
`npx @rneui/envinfo`
The text was updated successfully, but these errors were encountered: