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
Make gradients usable without constructing Two.Stop manually or round-tripping a callback ref through React state.
The current LinearGradient and RadialGradient wrappers accept a stops array, but there is no exported Stop component or hook and no declarative relationship between a gradient resource and a shape. The current README example supplies plain stop objects; Two.js expects Two.Stop instances and throws when it tries to bind those objects.
Desired capabilities
A final API may use components, hooks, resource props, or a combination, but it should support an ergonomic equivalent of:
Summary
Make gradients usable without constructing
Two.Stopmanually or round-tripping a callback ref through React state.The current
LinearGradientandRadialGradientwrappers accept astopsarray, but there is no exportedStopcomponent or hook and no declarative relationship between a gradient resource and a shape. The current README example supplies plain stop objects; Two.js expectsTwo.Stopinstances and throws when it tries to bind those objects.Desired capabilities
A final API may use components, hooks, resource props, or a combination, but it should support an ergonomic equivalent of:
Consumers should also be able to assign the resulting resource to
fillorstrokewithout a fragile callback-ref + state pattern.Related work
Acceptance criteria
Two.Stop.fillorstroke.