score:0
the problem is not with your doclick method, it is with the click method you have specified within it.
in this method:
doclick(index) {
this.props.click(index);
}
the problem you have is that you have not specified a click method prop.
either pass in a click method via the props (though i'd recommend instead using onclick handler), or handle the click event in your component. see my example here:
Source: stackoverflow.com
Related Query
- Problems tying onChange function to checkbox
- React: How to add onChange functionality inside of Function component using React Hooks? Need onClick event from a checkbox to influence input state
- function is not called onChange of Checkbox
- onChange function on checkbox isn't working | ReactJS
- Checkbox onchange function is always undefined in React component class
- How to api call in onChange function on CheckBox field React js
- First onchange checkbox execution doesn't run correctly function React Native Help pls
- Function onChange for Checkbox in ReactJs
- pass onChange function already argument checkbox
- React Checkbox not sending onChange
- Testing onChange function in Jest
- React Material-UI checkbox onChange event does not fire
- Checkbox onChange event is not handled by handleChange props by Formik
- React div container onClick conflicts with checkbox onChange
- Why is my React checkbox onChange handler firing on render and then not when the box is clicked?
- How to call two function in onchange using Formik
- Push checkbox value to array on state onChange
- React JS - onChange function is being triggered twice
- How can I test if a function is called onChange in a functional React component?
- React - onChange function 'this.state' is undefined
- React Material-ui Datepicker / Timepicker OnChange Event callback function encapsulation
- How to handle multiple onChange function from multiple input fields in Reactjs
- Enzyme/Mocha: How to test a react component function by firing an onChange event from a child component
- React/React Hooks: onChange function to change text is changing for all 3 elements simultaneously instead of just one
- Call parent function onChange
- onChange function in customInput from material ui
- ReactJS - Checkbox onChange event not firing
- How to prevent my array to updated again and again on onChange Function in React JS?
- How to push values into state by calling single onChange function - react
- React checkbox - Onchange checkbox, coming undefined for 1st time
More Query from same tag
- Reusable TextField in React
- (react + express) DOM on server - Return web pages (SSR)
- Pie Chart in Ant Design Charts don't have option to show label by percentage . How can i do it manually?
- Coffeescript - How to apply closure and anonymous functions
- Calling a component by name in React Router
- React Sending Props to Children
- Reduce returning string and not number
- Test simulating form input in React with Jest
- Transform excel 2D array into nested properties object with column names included
- Cannot find module 'enzyme' from 'setupTests.ts'
- React Flux implement dispatch chain
- After the second click Modal is not showing in my react boostrap table
- I have Authorization Bearer set in Fetch API but there is no Authorization in my Request Headers
- How to replace an underscore with letter React Hook
- Why does state not update correctly when calling setState() multiple times
- start an event at a specific timezone on react front-end
- Using font awesome styles in react
- I get undefined while trying to access state from root reducer with redux toolkit
- React access const outside of block scope
- React 16.8 hooks => how to properly inject an array of elements into the DOM
- What is withRouter for in react-router-dom?
- React useRef changes didn't cause the component rerender which depends on ref.current
- Swiper renderExternal example in Virtual Slides with React
- Private Route jsx in react JS
- React Redux - load response data before render
- How to `navigate` to new screen from button in header with react-navigation?
- react create dyamic menu by settings
- Best ways of rendering a nested JSON in react?
- Get ETH Balance with Ethersjs
- Call functional Component on button click in react