Closed hardfist closed 7 years ago
I don't think it is possible, since you would need to carry React Motion instance around your app or smth. If we allow to mutate defaultConfig
, it means all instances will get that. It is quite a bad design decision for a general-purpose library.
Instead, create your own spring
with your own custom default config. Something like
const myDefaultPreset = {stiffness, damping};
export const mySpring = (value, presetOverride) =>
spring(value, {...myDefaultPreset, ...presetOverride});
It seems that spring function has a defaultConfig, But It isn't exposed to user. but the animation according to defaultConfig seems a little slow, so I have to pass my customized spring presets to spring everywhere , so I wonder if you could expose defaultConfig to user to Customize. thanks!