You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modifying values halfway through a parcel chain can be fine (e.g. turning all chars to uppercase), but the idea breaks down when there are more input values than can be represented in the data type in state (e.g. number in state -> string for editing), because invalid values must be remembered somewhere so that the input doesn't immediately eliminate the user's changes. The keepValue prop on ParcelBoundary tried to solve this, but it has 2 massive downsides:
the state is stored in React state, so 2 fields editing the same data cannot share invalid states
its quite complex and adds a lot of code to the react-dataparcels package
Instead its possible to store the user-input value as meta, and apply it to the value when its valid. It's very clear to understand, and all state is stored in the parcel. Something like:
Modifying values halfway through a parcel chain can be fine (e.g. turning all chars to uppercase), but the idea breaks down when there are more input values than can be represented in the data type in state (e.g. number in state -> string for editing), because invalid values must be remembered somewhere so that the input doesn't immediately eliminate the user's changes. The
keepValue
prop on ParcelBoundary tried to solve this, but it has 2 massive downsides:react-dataparcels
packageInstead its possible to store the user-input value as meta, and apply it to the value when its valid. It's very clear to understand, and all state is stored in the parcel. Something like:
The text was updated successfully, but these errors were encountered: