Comments (3)
Hello @Phanabani ,
This was intentional when I've created the library. Making a deep copy can be heavy (depends on source object size) and I'm afraid that doing this will, under some circonstances, create a performance drop...
Do you think this is needed ? Don't you think this is an edge case ?
Regards,
Oxyno-zeta
from react-editable-json-tree.
Oh, I didn't expect that it would be a big performance issue. I suppose you're probably right though, cloning the same array for every node, multiple times (for each callback)...
It's definitely an edge case, but I made the issue because I had hit this edge case myself in my own code. 😅 Admittedly, I wrote the code when I was just beginning to learn programming, but it still confused me a lot when keyPath.push(key)
somehow broke everything. I didn't realize mutating the array in place would be bad. Of course I ended up just using keyPath = keyPath.concat(key)
.
What about using Object.freeze(keyPath)
instead to help prevent mutations and give more useful error output to users?
from react-editable-json-tree.
That can be a good compromise yes. Seems to be a good idea !
Ahah no problem for the beginning. It is normal and you aren't the only one ahah.
Oxyno-zeta
from react-editable-json-tree.
Related Issues (20)
- Use create-react-app for the testing page
- Rewrite test page using functional components and typescript
- Rewrite core library using functional components and typescript
- Update CI tools to use parcel
- Disable `allowFunctionEvaluation` by default
- Add Github project for v3.0.0 HOT 2
- Update dependencies
- Migrate away from react-hotkeys
- CircleCI permission denied error HOT 6
- Fix npm publish task missing HOT 4
- Use GitHub actions for CI? HOT 2
- Remove CircleCI integration HOT 1
- Fix dev app's "Read Only Function" checkbox
- Clean up checkbox logic in dev_app
- inputRef is null with custom input elements HOT 4
- Remove custom element generators in favor of another implementation
- Add documentation about refs being necessary for inputElement
- Customize inputElement not working... HOT 2
- Custom Text Color and Size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-editable-json-tree.