question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance Issues setting a numeric string in the name prop of Field component

See original GitHub issue

I am creating a form that will send through a json string where the name of the field is the membersID (a numeric string).

My Field Component is looking like this. <Field label="hours" name={[‘member’][${member.id}]['hours]} type="number" component={renderField} />

renderField

screen shot 2017-01-25 at 2 33 45 pm

The member object looks like this { "id": "234521", "name": "John", }

This appeared to work well when I was testing with small member ids as shown below

screen shot 2017-01-25 at 2 18 58 pm

But when I use actual member ids it can take several seconds (over 10) to get a response as I notice it is creating a null object for each number from 0 to the highest memberID. (this also happened with the small numbers but no performance issue)

eg

saveMemberData() { console.log(Date.now()); console.log('saveMemberData',this.props.formData); }

screen shot 2017-01-25 at 2 21 41 pm

Is there another way I can approach this or is there an issue with the library?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
huan086commented, Mar 29, 2017

I’ve a suspicion that the redux viewer is causing the performance problem by iterating over the sparse array. Could you measure the performance again after turning off the redux viewer?

0reactions
lock[bot]commented, May 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native TextInput that only accepts numeric characters
I remove any non-numeric characters from the text. Then put the text in a state field. Then update the TextInput through it's Value...
Read more >
Typechecking With PropTypes - React
In this example, we're using PropTypes.string . When an invalid value is provided for a prop, a warning will be shown in the...
Read more >
How passing props to component works in React
This demonstrates that you can pass any type of data available in JavaScript — such as number , Boolean , or object —...
Read more >
react-component/field-form - GitHub
It's a bug but user use as a feature which makes fixing will be a breaking change and we have to keep it....
Read more >
Control numeric edit field appearance and behavior - MATLAB
Numeric edit fields are UI components that allow users to type numeric values in an app. Properties control the appearance and behavior of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found