score:0
firstly, flamegraph()
creates a new instance of flamegraph
, you'd need to use graphref.current.destroy()
. secondly, you'd want to destroy this not when the data has already been loaded, but just as it starts to load, right? because that's the operation that takes time.
consider the following:
const cleangraph = () => {
if (graphref.current !== undefined) {
graphref.current.destroy()
}
}
const fetchgraph = (filters: filter) => {
setfetching(true)
cleangraph()
getflamegraph(
number(projectid),
filters.startdate ? filters.startdate.unix() : 0,
filters.enddate ? filters.enddate.unix() : 0,
sourceid,
sourceline
)
...
}
Source: stackoverflow.com
Related Query
- Removing d3-flame-graph when loading new data
- Preventing UI flicker when loading async data in React.js
- React and Socket.io: Able to get initial data - but view doesn't update when a new post comes in
- ReactJS - How could I wrap the cell text in MaterialTable when typing in data for a new row?
- Re-rendering Table component when parent passes new or updated data
- React Native FlatList re-renders the already rendered items when adding new data
- How to pass data to a component when it renders in new window
- React/Redux - When should you fetch new data from an API to update your store?
- show loading when fetching data react
- Loading screen when fetching data via Redux
- Ant Design table continues to show loading even when the table is populated by data
- React Router "Link to" does not load new data when called from inside the same component
- Show spinner when data is loading on react
- Component won't reload with new data when route parameters change
- D3.js how to update chart when with new data
- Show a loading page when data is fetching - React Redux
- How can I disable the Highstocks range selector buttons when loading data asynchronously?
- Must I specify unique Loading booleans when fetching data via multiple async functions within useEffects in React hooks to avoid concurrency problems?
- Loading when fetching firestore data
- Data from the backend is not appearing when you assign it into new object on the front end
- Why my data is flickering between previous and new when state is updated in ReactJS?
- Recharts chart not updating when using setInterval to periodically append new data
- React Router : Data fetched using axios doesn't save when navigating to new route
- How to load data from redux store when redirecting to a new page
- How can I wait for or cancel a data update in componentDidUpdate when a new update was triggered?
- Send email when Firebase database gets new data
- How can I refetch() my Query only when new subscription data arrives?
- React+Express - refresh page when fetching new data
- What are the sequence of events when loading xhr data into a react redux routed page?
- MUI DataGrid - forcing filter and sort state to be reset when getting new data
More Query from same tag
- Jest test error: ...subscribe is not a function
- Trying to submit a formik form to an action
- Array.splice not woking when there is one index left
- How to make a onChange calling only with the submit button?
- Setting state in React context provider with TypeScript, functional components and hooks
- React 0.14-RC-1 -- OnMouseEnter & OnMouseLeave -- Change state / style
- My React function being passed down as props is not being invoked
- React bootstrap navbar1
- Why do the async function works after this.setState?
- Create multiple redux-form on same page and submit with same button
- data undefined in React Hook Form inside a NPM input fields
- stop re rendering after promise is fulfilled
- How to push item into array of object in array with useState?
- Do calculations with users input
- React VictoryBar style difficulties
- SparkLines ReactJS - Received NaN
- how update the value of useEffect() hook on button click
- React Custom Component Styling
- Passing props from one component to other component
- Access query parameters using axios
- Make material-ui grids wrap, on larger screens
- How to update a CSS Grid without re-rendering a specific component in ReactJS?
- How to resolve module not found error in webpack/reactjs app?
- How to pass dropdown values into mongodb in react?
- How to solve this MERN stack filebase64 error?
- passing props as classNames in next.js
- typescript parsing - gives error outside of conditional statement
- How to use Memory Route In React Js ? What is exact method to use route?
- How can I mock a library in jest?
- Using the React Children code example is not working