Questions tagged [memo]

144 questions
0
votes
0 answers

Adding component to array of components without re-rendering the existing components? [Next.js]

I have a dynamic array (state) of React components – and each components has an entry-animation on mount. But every time a component is added to the array all the components re-renders – which also triggers the entry-animation for all…
AxelBoden
  • 23
  • 3
0
votes
0 answers

I want to use a custom button to increment a input number field but it is re-rendering the parent component and losing a state value

I have an input element for a number that increments, I want to create my own increment buttons because I don't like the default buttons, they don't work well on mobile. So I created a button element that onClick handles the change in the number…
artworkjpm
  • 1,255
  • 2
  • 19
  • 40
0
votes
2 answers

Substituting a reserved value dynamically doesn't work

I am trying to copy one dynamically reserved array into another, both of which are placed in a vector. But it does not work. Why? struct A { int *p; }; int main() { vector v; A test; test.p = new int[5]; //fill the array …
0
votes
0 answers

iPhone voice memo corrupted

I have recorded a voice memo for an interview. The duration is 26 minutes and 58 seconds. The first 4 seconds play on an iPhone and then it stops playing. I have exported the entire file to my Windows pc. I tried to import it into VLC, audacity and…
P. Hermens
  • 25
  • 7
0
votes
1 answer

Reducing re-renders in React - Not going as expected

I am attempting to clean up my app and reduce the amount of re-renders that occur by using the React.memo feature, however I am struggling to understand fully why my page/component is re-rendering the amount of times it is. I believe it is down to…
physicsboy
  • 5,656
  • 17
  • 70
  • 119
0
votes
0 answers

React.Memo is not working when prevProps and nextProps are the same

const propsAreEqual = (prevProps: IRangeDatePickerProps, nextProps: IRangeDatePickerProps) => { return prevProps.details === nextProps.details; } // At botton of the file, i memoize the component: export default React.memo(RangeDatePicker,…
0
votes
3 answers

Export MS Access Memo field and convert Unicode

I have an Access 2003 database. A table has a Memo field and I'm having issues with getting that data out. Exporting that field to a txt or csv chops that field off (255 characters) Exporting as Excel gives me strange characters for…
wesgarrison
  • 6,975
  • 5
  • 30
  • 39
0
votes
0 answers

Stop re-rendering mapped lists when parent state changes

How do I avoid mapped child components from re-rendering at onParent state change? I have already tried memo in child component and useCallback in parent component to memoise function that updates the state with an empty array as dependencies. I…
0
votes
1 answer

Wrong result if a recursive function is called twice successively with different parameters

I have this recursive function: def coinChange(coins, amount: int, minimum = float('inf'), memo={}) -> int: if amount in memo: return memo[amount] if amount < 0: return -1 if amount == 0: return 0 for coin in coins: x =…
0
votes
1 answer

Troubleshooting memo call React+Typescript

I need your help. Started learning Typescript recently and got one problem with React. I try to wrap my Router with React.memo(). Smth like this: export const Router = React.memo(({ isAuth }) => { if (!isAuth) { return…
0
votes
3 answers

Accessing form members from another class

The point is to notify the user using the memo when a packet is received/sent in a TCP Client. The old code was extra dumb,I used a Timer that used to add text in the memo since the Timer has access to the form members,lol. The old code: //Memo.Text…
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
0
votes
1 answer

Is there a default function I could use for comparisons with React.memo?

I have a component that have an object as prop; like const myData = { "location" : ["http://example.com/1.ogg", "http://example.com/2.mp3"], "identifier" : ["http://example.com/1/", "http://example.com/2/"], "title" …
gordie
  • 1,637
  • 3
  • 21
  • 41
0
votes
1 answer

ReactJS: Child component re-rendering on OnChange event from parent

I have a parent component with two children: Child1 that displays the information and Child2 that changes the information through input. My goal is to keep the Child1 information from re-rendering until a save trigger would be passed from the Child2…
Icarus23
  • 167
  • 2
  • 11
0
votes
0 answers

Python memoization: necessity of passing back memo in recursive calls

I just learned about memoization for optimizing recursive functions. The solution for memoizing a Fibonacci function was provided as: def fib_memo(n, memo={}): if n in memo : return memo[n] if n in [1,2]: return 1 memo[n] =…
ZwiTrader
  • 195
  • 1
  • 2
  • 12
0
votes
1 answer

Access 2010: filter from multiple records in memo field?

I've poured through here looking for an answer to this, but haven't found it anywhere. I have an Access 2010 database with two tables: one with about 14k codes and definitions(all five digits, including some letters). one with a total of 900k…