Questions tagged [memo]

144 questions
2
votes
1 answer

React js memo is not working as expected after passing props from parent to children

Lets say I have a component that maintains the state of some children components. This component holds an update function that contains the logic for update the state. I pass the state and the update function to the children component, that are…
assembler
  • 3,098
  • 12
  • 43
  • 84
2
votes
1 answer

Should I remove all unecessary usage of usecallback and memo in a React app?

im working on a relatively large React codebase and I've seen that the previous developers used memo and usecallback liberally with the thought that by using these would improve performance. Obviously not, here is an example export default function…
fardown
  • 713
  • 2
  • 12
  • 23
2
votes
1 answer

React how to memoize a component that receives a very nested object/array as prop

React.memo uses a shallow comparison to determine if the props are equal, but I need to pass an object or array as prop, so I went into an areEqual condition, but the currentProps and nextProps values are always the same. I mean, the component does…
assembler
  • 3,098
  • 12
  • 43
  • 84
2
votes
2 answers

A reimplementation of _.reduce()

The code below is a reimplementation of the _.reduce() method. It's not mine, but I am using it to get to grips with how _.reduce works. It is currently failing on two tests: should be able to reduce a collection to a single value - AssertionError:…
jahe
  • 41
  • 3
2
votes
2 answers

How set displayName to a React stateless component with memo?

This is a exemple the implementation of the stateless component: import React, { memo } from 'react'; const Create = memo(props => { return
CREATE TEST
; }); Create.displayName = "Create"; export default Create; In…
mvaldetaro
  • 152
  • 8
2
votes
1 answer

Python dbf package: Reading files with memo data does not work

In Python 3.6.3 under Anaconda I try do read a dbf file with memo data in it. The file is exported from a commercial software. I use the dbf package, version 0.97.11. The file type is: In [10]: dbf.table_type('C:\\Users\\kmec\\Documents\\Python…
runnerup
  • 21
  • 3
2
votes
1 answer

Can I use useCallback or useMemo to cache the result of my function?

Let's say there is a function inside a component, for example like this: const MyComponent = ({data}) => { const myFunction = a => a+1; return
data.map(num => myFunction(num))
} I…
Anna
  • 2,911
  • 6
  • 29
  • 42
2
votes
1 answer

Function components in react native

I am trying to change view of ListItem by pressing on it. In My screen which is normal React component i have functional List component and selectedItemState (only 1 or no items will be selected). In List there are few also functional ListItem…
jStefko
  • 33
  • 1
  • 6
2
votes
1 answer

How to get text position (in pixels) in TMemo?

I want to get the position/placement in pixels of a text (aWord) in a TMemo. My code is something like this: var Size: TSize; Pt: Cardinal; aWord: string; x, y: Integer; begin ... Pt := Perform(EM_POSFROMCHAR, aStart-1, 0); …
Gabriel
  • 20,797
  • 27
  • 159
  • 293
2
votes
1 answer

SendInput showing data sent out of sequence

I am experimenting with SendInput by sending strings to a memo. I mix the SendInput commands with calls to Memo.Lines.Add('....'). To my surprise all the Memo.Lines.Add commands execute before any of the SendInput routines. Why? How can I get…
Rudi
  • 203
  • 2
  • 12
2
votes
1 answer

Best practice for working with long texts in ms-access

I would be very thankful if somebody resolves my problem. I'm new in working with Ms Access and I still gain experience on its basic functionality. I have a table MyItems. 2 of its fields are: ItemCode and ItemName. ItemName is a very long text…
Peter
  • 23
  • 6
2
votes
1 answer

How to use Excel VBA to extract Memo field from Access Database?

I have an Excel spreadsheet. I am connecting to an Access database via ODBC. Something along then lines of: Set dbEng = CreateObject("DAO.DBEngine.40") Set oWspc = dbEng.CreateWorkspace("ODBCWspc", "", "", dbUseODBC) Set oConn =…
the.jxc
  • 3,373
  • 21
  • 21
2
votes
3 answers

Delphi memo lines in one line

In a TMemo field I have 3 lines: line1 line2 line3 Is it posible to get all three lines as one string? Example: line1,line2,line3
user2997342
  • 87
  • 2
  • 3
  • 8
2
votes
2 answers

Sorting a memo in Delphi

I have to make an highscore memo for my school in Delphi 6. Is there a way to sort the MemoLines on numbers or alphabet? I use 4 Tedits and 1 TMemo. If the game ends, my code will check who has got the highest score. This is how to check if Player1…
Ömer Bastos
  • 49
  • 1
  • 7
2
votes
1 answer

Pimping scalaz Memo

I like the new scalaz Memo functionality but find it lacks 2 things: 1) it hides the underlying Map, which I need access to--at least a List of all the values, and 2) I want a version that's implemented using a val…
Greg
  • 10,696
  • 22
  • 68
  • 98
1 2
3
9 10