Hey,
So we ported some of this to use on Android phones but this line seems to be wrong:
const nextTree = { [key]: JSON.parse(value), ...tree }
If you already have the key in your existing tree, then it will just overwrite your new value. So you can write a value once, but then you can never update it again.
Suggestion is to use something like
const nextTree = Object.assign({}, tree, {key: JSON.parse(value)})
Or even a simple assign if you don't mind it being mutated.