score:2
Accepted answer
you can trigger a re-render by adding a key
property in combination with this.state.language
to the aggridreact
component instead of using this.forceupdate()
. this should cause a re-render when you change the language via the button clicks:
<aggridreact
key={this.state.language}
... other props
/>
here is an example in action.
i don’t see any issues with your code, this seems like more of an issue with the grid component failing to update. you are updating state correctly.
hopefully that helps!
Source: stackoverflow.com
Related Query
- Why forceUpdate doesn't work after click button?
- why state is not updated after button click in setinterval react?
- Ant design Tree defaultExpandAll doesnt work with button click for react
- Why state is not updated after button click using hooks?
- Why after I click the go back button, the cancel button doesn't work?
- Why is UI not updating after button click in React?
- I wanna console.log the value after clicking the submit button once and to delete the previous mapped items, but it doesnt work
- How I can disable a button in React js for 5 seconds after click event
- React Bootstrap + Formik - show errors after I click submit button
- Cypress wait for API after button click
- Why does React.createRef() for material-ui Button element in TypeScript not work correctly?
- why don't work react-router-dom after build?
- close popup react-leaflet after user click on button in popup
- Why number validate rule doesnt work in antd
- Why does custom Button component using MUI Button not work on hover with Tooltip?
- React Component Doesn't Update After First Button Click
- React hooks useInterval reset after button click
- Why does the Sign In With Google button disappear after I render it the second time?
- Why button click trigger is different from setTimeout() trigger?
- How to get the time in seconds after click on submit button using React Count Down Timer
- Why useState doesn't work after fetching data
- Why popstate doesnt fire my function when back button is clicked? (mobile ios chrome)
- Why the input doesnt work when generated by React
- Testing navigation in react with MemoryRouter after a button click (jest, enzyme)
- Updating text after button click with react.js
- React: re render componet after button click
- React-router doesnt work after upgrading from 0.13 to 2.8.1
- How to animate svg picture after a button click in React
- If I create custom Button with material-ui ButtonGroup doesnt work
- Test if each button in a component is disabled after click [React]
More Query from same tag
- Data from API is displaying in the console but not in the DOM, why?
- Bootstrap css rules applied over custom rules after heroku deploy?
- ReactJS - how a child access it's parent's props?
- Promise.all raises TypeError: undefined is not a function
- Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'
- React-Redux , state not updating correctly
- Cannot find module "./components/video_list"
- Papa parse returns Data array in which everything is converted to string
- React: why is a correct file path throwing a'module not found' error when being mapped?
- react js fetch api using file upload not being sent to body
- Cannot install react-app because of a node version problem but I do have the last version installed
- React Router, lifecycle when browser's back button is clicked
- Setting background image to useState variable causes it to become undefined
- How do I make the bar width on Chartist.js responsive
- How to prevent an embeded type-form to scroll after loading
- How to send react app to client with express when you have routes that are authenticated and some that are not?
- call function from useEffect and other function
- how to get value from dropdown list in react?
- JSX error: Unexpected Token, expected ","
- React - updating an object array in the state with setState
- Getting empty string from HTML input event in Firefox
- How can I load environment variables via command line when running a node.js app in cluster mode with PM2?
- How to render nested object elements map method
- Trying to display table using data from chart
- How do I programatically fill input field value with React?
- Props is not defined React js
- Calling a custom hook from an onClick by passing it arguments
- How to join a react app and an express app?
- Redux saga update a nested array of object state
- Flux/React Complex Reusable Component