React-native, render a button click dynamically

Hanane

i want to generate a button click dynamically for a TouchableOpacity in react-native, i didn't find anything about that,

all i want is to call the TouchableOpacity onPress from a fuction (or see its effect on the button)

in titanium we were doing $.button.click i tried using Animated but no luck https://facebook.github.io/react-native/docs/animations.html

so can anybody help? thanks in advance

oblador

It's really inadvisable but something like this should work:

simulatePress() {
  this.touchable.props.onPress();
}

render() {
    return (
        <TouchableOpacity ref={component => this.touchable = component} onPress={() => console.log('onPress')}>
          <Text>Tap me</Text>
        </TouchableOpacity
    );
}

Really though, what you are trying to achieve? There is likely a better way to do it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

React-native, render a button click dynamically

From Dev

React native button click render different components

From Java

Not sure how to render this component with click of a button in react-native

From Dev

How to dynamically Load API Data on a button Click in React Native

From Dev

Render a component onPress(TouchableOpacity/Button) in React Native

From Dev

React native button click move to another screen

From Dev

Render Content Dynamically from an array map function in React Native

From Dev

How do I render a component when a button is clicked in React Native

From Dev

How to change screen in react native with react-navigation on click of a button?

From Dev

click() for dynamically created button

From Dev

React Native - Dynamically Add Element to DOM on button press

From Dev

How to validate email and password on click of submit button in React native?

From Dev

React native:how to get Text value on a button click?

From Dev

Render HTML in React Native

From Dev

React Native staggered render

From Dev

React Native View Render

From Dev

React Native: Render on Fetch

From Dev

Render partial view on button click

From Java

Dynamically building a render function in React

From Dev

Click a button on dynamically changed element

From Dev

Simulate click on dynamically added button

From Dev

dynamically adding a tab, on button click

From Dev

Simulate click on dynamically added button

From Dev

on click function to dynamically created button

From Dev

Create controls dynamically on button click

From Dev

show textbox on button click dynamically

From Dev

Dynamically render items on click [JS/JQuery]

From Dev

Button Click event not firing for dynamically created button

From Dev

how to render objects in react native?

Related Related

  1. 1

    React-native, render a button click dynamically

  2. 2

    React native button click render different components

  3. 3

    Not sure how to render this component with click of a button in react-native

  4. 4

    How to dynamically Load API Data on a button Click in React Native

  5. 5

    Render a component onPress(TouchableOpacity/Button) in React Native

  6. 6

    React native button click move to another screen

  7. 7

    Render Content Dynamically from an array map function in React Native

  8. 8

    How do I render a component when a button is clicked in React Native

  9. 9

    How to change screen in react native with react-navigation on click of a button?

  10. 10

    click() for dynamically created button

  11. 11

    React Native - Dynamically Add Element to DOM on button press

  12. 12

    How to validate email and password on click of submit button in React native?

  13. 13

    React native:how to get Text value on a button click?

  14. 14

    Render HTML in React Native

  15. 15

    React Native staggered render

  16. 16

    React Native View Render

  17. 17

    React Native: Render on Fetch

  18. 18

    Render partial view on button click

  19. 19

    Dynamically building a render function in React

  20. 20

    Click a button on dynamically changed element

  21. 21

    Simulate click on dynamically added button

  22. 22

    dynamically adding a tab, on button click

  23. 23

    Simulate click on dynamically added button

  24. 24

    on click function to dynamically created button

  25. 25

    Create controls dynamically on button click

  26. 26

    show textbox on button click dynamically

  27. 27

    Dynamically render items on click [JS/JQuery]

  28. 28

    Button Click event not firing for dynamically created button

  29. 29

    how to render objects in react native?

HotTag

Archive