0

I need to pass onTaskShow, getColumnId params to OnClick. But do not know how to do it correctly.


export default({
  column,
  onTaskShow,
  getColumnId
}) => (
  <div className="column">
    <button type="button" class=" addBtn btn btn-success" onClick={onTaskShow, getColumnId}>Add Task</button>
        

2 Answers 2

2

Create a function that use all the function that you need:

onClick={()=>{
   onTaskShow();
   getColumnId();
   }
}

If you need the event:

onClick={(e)=>{
   onTaskShow(e);
   getColumnId(e);
   }
}

Hope it helps!

Sign up to request clarification or add additional context in comments.

Comments

0

you cannot do this in React. An event can be handled by one function. you can do this

onClick={()=>{
   onTaskShow();
   getColumnId();
   }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.