-
-
Notifications
You must be signed in to change notification settings - Fork 221
Description
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
toPath splits 'foo["bar.baz"]' to ['foo', '"bar', 'baz"']
It's impossible to use a nested object key with . in the name and messy to use a nested object key that's not a valid JS identifier. 'foo["bar.baz"]' is an idiomatic JS pathstring supported by libs like lodash.get:
_.get({foo: {"bar.baz": 3}}, 'foo["bar.baz"]') // 3I have to use an arbitrary, user-entered string value as part of the nested object key, so I need final-form to support quoting and escaping properly here.
My field name that was working fine in redux-form and is now broken with final-form is "Channels["{\"type\":\"MetadataItem\",\"connectionId\":14,\"direction\":\"FROM_GATEWAY\",\"tag\":\"mqttChannel1\"}"].internalTag".
mqttChannel1 is the user-entered value, and I'm using JSON.stringify to safely escape the object that forms this key.
What is the expected behavior?
toPath splits 'foo["bar.baz"]' to ['foo', 'bar.baz']
What's your environment?
not relevant