Closed r1y4h closed 3 years ago
Code snippet:
const key = 'with/forward/slash' const form = new MobxReactForm() form.add({ key, type: 'text', }) form.del(key) //will throw "Cannot read property 'fields' of undefined"
I found the reason inside Utils.js container function where the last item from the path is stripped out by this line of code:
const cpath = _.trim(path.replace(new RegExp('[^./]+$'), ''), '.');
Is this by design, should we avoid using "/" in key? But why does it accept such key (able to add the field) but del fails?
Thanks for any help.
Code snippet:
I found the reason inside Utils.js container function where the last item from the path is stripped out by this line of code:
Is this by design, should we avoid using "/" in key? But why does it accept such key (able to add the field) but del fails?
Thanks for any help.