score:0
Accepted answer
you can use ref='picker'
for your parent component and refer to it by this.refs.picker
<modalpicker
data = {[
{key: '1', label: '1'},
{key: '2', label: '2'},
{key: '3', label: '3'}
]}
ref='picker'
initvalue = 'select option'
selectstyle={{
height: 200
}}>
<navigationbar
title={{ title: "modaltest" }}
rightbutton={{ title: "open modal",
handler: () => this.refs.picker.open() }}
/>
</modalpicker>
Source: stackoverflow.com
Related Query
- Is it possible to call a function in a parent component in React Native?
- React 16: Call children's function from parent when using hooks and functional component
- react functional component with ag grid cannot call parent function via context
- Can't call child component method from parent component in React Native
- call parent function from child of child component react
- how to call parent function controller from directive react component angularjs + reactjs?
- Unable to call parent component function from child component in React
- React - call function in child component if parent state changes
- Can't call function in parent component from child component using React
- How to have a React child component call a function from a parent component
- React - Call Parent function from OUTSIDE of Child Component
- Call a function on a react child functional component from parent
- React hooks: call component as function vs render as element
- React JSX vs function call to present component
- React Native pass function to child component as prop
- Call function from another React component
- Call function onPress React Native
- How to get parent component name in React function component
- Call API Every X Seconds in React Function Component
- passing data from child to parent component - react - via callback function
- Call React Component Function from onclick in dangerouslySetInnerHTML
- Unable to call child function from parent using refs with functional component
- is it possible to dispatch function when react component is unmount ? (React functional componet)
- how to call function of child in functional component from parent in react.js?
- How to call a component function on other component, but from the other component ? React
- React Native : Access Component state inside a static function
- Is it possible to type a React function component with TypeScript without using arrow functions?
- React Higher Order Component - call function in the wrapped component from the wrapper component
- Correct way to call passport js function from react component
- Trigger child function from parent component using react hooks
More Query from same tag
- How do I avoid code duplication and apply Boolean operator only to the source of image?
- Form reset issue after get response via API in react js
- Next JS build isn't building out every path
- react how to stop useffect causing components to rerender
- ReactJS: how to access prop from child component
- How can I connect to the store in non-react components
- swagger ui topbar plugin react ts
- How to unselect all rows from Material-UI's <Table> in ReactJS?
- ReactJS gives no DOM output
- "Uncaught ReferenceError: require is not defined" when importing into App.js for React App created using CDN links
- Uncaught Invariant Violation: Target container is not a DOM element.- Reactjs
- How to display array element bu opening modal?
- To keep waiting untill all APIs respond
- Use React componentDidMount in a modal/overlay react component
- How can I pass auth headers to other components
- Uncaught ReferenceError: process is not defined / Line 0: Parsing error
- How can I call the function of a parent component inside of a child component?
- On using SelectField from Material-ui MenuItem are not showing
- React Hook Forms + Material UI Checkboxes
- react input field will loose focus when filtering data
- How do I correctly remove event listeners in React.js?
- Why the () in this.state when using the current state as a parameter
- How do I shallow test a react component wrapped in memo and withStyles?
- Close first dropdown if open the second one
- How to make toolbar in material-ui transparent?
- mapping some images with out key and value pair in react
- Why doesn't the image from the external link work in gatsby?
- Augment react-router module with react-router-relay typings
- Alert prompt to function not working in react native
- react-draggable not working with custom components