score:0
i'm guessing your are not creating a new array instance when updating the clickedmarkers array. if you mutate the array directly, react will not know the property has changed.
try using the spread operator to create a new array instance when updating the clickedmarkers state in the onclick function.
onclick = (e, markerindex) => {
clickedmarkers[markerindex] = true; // change value logic
this.setstate({clickedmarkers: [...clickedmarkers]}); // spread operator to create new array instance
}
Source: stackoverflow.com
Related Query
- Component props is not being updated in react
- D3 line chart component not being updated inside useEffect in React
- React - Inline dynamic component style not being updated onMouseOver and onMouseOut events
- React Redux : My React component not receive updated array as props
- React - state not getting updated after a prop being sent from another component
- Redux props are being received in Redux DevTools but not in the React component
- Props not being passed to React component
- React TypeScript - Component properties not being updated when parent state is changed
- React Child Component Is Not Rerendering When Props Are Updated
- props not being updated properly in Login page button action with React JS
- React global variable not being updated inside function that passing to children component
- React shouldComponentUpdate() is called even when props or state for that component did not change
- componentDidMount() not being called when react component is mounted
- React TransitionGroup and React.cloneElement do not send updated props
- Component not updating when I change the props that I pass to it in React
- React component not re-rendering after props change
- How to test default props functions is attached to component or not ? | React | Jest | Enzyme
- Why is child component not receiving updated value from parent in React Native?
- list.map not being displayed in React Component
- Why is React component rerendering when props has not changed?
- React component not rerendering when props changes
- React component not rendering props coming from parent
- Functional Component in React is not updating on props change
- Why are my props not being passed into my component when mount rendering?
- React child component not rendering props from parent value
- Component not returning UI even though props are being delivered
- React component props not changing when they should?
- Redux store is being updated but the component is not re-rendering
- React component is not being displayed on browser, getting empty screen
- React - component state not being set
More Query from same tag
- Nothing was returned from render in react functional component
- Programmatically change Redux-Form Field value
- How to determine how much user will scroll by pixels when user start scrolling using mouse wheel in Javascript
- How delete a specific item in localstorage?
- Getting "Uncaught TypeError" in a React app
- Execute function in React when user stops typing
- Issue wtih exit property - framer motion
- How to write each iteration in state?
- Transpile single React component to use as JS widget
- Need help to make validation when two range contradict
- How can I pass touch events to react-draggable
- Don't map a list if it's undefined
- React-Konva: Prevent draggable image reverting position after placing point
- Relay Modern isn't sending network request to GraphQL Server
- Unsubscribe subscription in Apollo Client
- How to create dynamic route in gatsby
- .NetCore React JS: How To Prevent .gltf File From Being Routed?
- How to fix 404 when reloading page in reactjs
- Best way to navigate between pages and handle back button in react js
- Unable to access Query String parameters inside a React Component
- How to access env values for react in mern app deployed on heroku?
- Whats the non-jsx equivalent of dangerouslySetInnerHTML?
- Filtering out items from an API call if they share the same value on a key
- How to check if Dom Element or React Component
- Unable to figure out the bug in merge sort
- How do I setup environment variables for multiple environments?
- How to keep content inside Footer and Header in React Component?
- Sorting assets based on name or id
- use-effect doesnt work, only after refresh page
- ReactJS Keydown on Input