Linked Questions

10 votes
2 answers
23k views

hey ~ I'm trying to fire a submit function and a google click event on the same onClick in React. How do I do this in React? This is the code: <button className={s.button} onClick={this.submit} ...
bluegen1e's user avatar
  • 101
-2 votes
1 answer
568 views

i have two different function Deactivate = () => { //logic for deactivate } Activate = () => { //logic for activate } return ( <div> <Toggle ...
benzene's user avatar
  • 59
-3 votes
1 answer
82 views

<Button onClick={(e)=>setId(_id); handleDelete()}>Delete I tried this way, but it gives error.
shahnmah's user avatar
31 votes
9 answers
30k views

I am trying to wrap my head around promise object in JavaScript. So here I have this little piece of code. I have a promise object and two console.log() on either side of the promise object. I thought ...
AL-zami's user avatar
  • 9,204
14 votes
4 answers
38k views

All: I wonder if it is possible that binding multiple event handlers to same event? For example: var LikeToggleButton = React.createClass({ render: function(){ (function toggle(){ ...
Kuan's user avatar
  • 11.4k
4 votes
1 answer
6k views

I've seen a lot of threads about calling multiple traditionally declared functions in React onclick, but I'm confused how I could implement that with arrow functions. I have a function called ...
Evan Hsueh's user avatar
3 votes
1 answer
3k views

I'm writing an extended version of the input element. Here is a simplified version of it: var MyInput = React.createClass({ render: function () { return ( <div> ...
Chavdar Slavov's user avatar
-1 votes
2 answers
5k views

I am trying to call two functions on the same onSubmit event in React. My approach is two wrap the two functions in a parent function, and call the parent function, as follows: Submit() { ...
user8891334's user avatar
1 vote
2 answers
3k views

This is an example of something I'd like to understand better syntactically in JSX. Problem: This works: <button onClick={ !isRecording ? beginRecording : endRecording } > </button> ...
lys's user avatar
  • 1,059
2 votes
1 answer
3k views

I'm creating a React component (parent) that receives a link, button, or other React component (child) as a property, and I want to attach an additional click handler to the passed-in component. This ...
Jared's user avatar
  • 1,264
0 votes
3 answers
1k views

I have the following two buttons: <View style={styles.button}> <Button title="ADD" onPress={createDocumentHandler}/> </View> <View style={styles....
klippy's user avatar
  • 253
0 votes
3 answers
732 views

I am trying to call two multiple functions onClick.It doesn't work when i try to do it.But it works in single function.these are the two functions. //first function saveValue = (e) => { // ...
ariful Islam's user avatar
1 vote
1 answer
1k views

I'm passing a function to a component (which works btw, loads language translated product list as json) : <a onClick={this.props.lang_zh} href="#">ZH</a></li> I also have a ...
coreyl's user avatar
  • 67
-1 votes
1 answer
1k views

The issue lies within the <Button> component, specifically in its onClick event handler, which needs to perform two tasks: Navigate back to the previously visited route using the useNavigate ...
Nishan Kumar's user avatar
0 votes
3 answers
220 views

I need to execute 2 functions based on one onClick event. for this, I found some methods Via stackoverflow. (Referred Call multiple functions onClick ReactJS) But, in my case if I specified as ...
Vithursa Mahendrarajah's user avatar

15 30 50 per page