logo
Search
showing results for - "pass text to button component react"
Tiago
14 Apr 2018
1// general component
2<ButtonComponent text="General" />
3
4 // button component
5const ButtonComponent = (props) => {
6  const handleClick = () => {
7    console.log(props.text);
8  };
9
10  return (
11    <button onClick={ handleClick }>{ props.text }</button>
12  );
13};
source
similar questions
how to pass value from one component to another in react nativepass data to component reactget value of input element on button click reactpass data reactsend props from one component to another on button clickhow to pass props in reactreact pass prop to parentpass parameter to handleclick reactreact get input value on button click functional componentpassing data in route reactreact how to pass the input target valuereactjs pass slug to parameter onclickreact onclick parameterreactjs net pass value to reactscroll to a input on button click react nativehow to send data to another page in react from button
queries leading to this page
jsx pass text of a buttonpass component inside button reacthow to pass buttonin reactpass text to button component reactpass button text to function in reacthow to pass button text on click in reacthow to pass value through button in reactjspass text to button component react
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue