Summary
Make every renderer value accepted by the Canvas TypeScript API work at runtime, and define what happens when Two.js constructor options change after mount.
Current behavior
The React prop types accept both short aliases and Two.js renderer names:
canvas / CanvasRenderer
svg / SVGRenderer
webgl / WebGLRenderer
The short aliases are currently passed directly to new Two(...). Two.js expects renderer class names (or values from Two.Types), so a value such as type="canvas" fails with Two[this.type] is not a constructor. The README currently demonstrates type="webgl".
Additionally, the Two.js instance is constructed once. Later changes to type, ratio, overdraw, smoothing, or autostart are not applied and do not warn.
This issue does not propose restoring the removed container prop; the current styling API is intentional.
Acceptance criteria
Summary
Make every renderer value accepted by the
CanvasTypeScript API work at runtime, and define what happens when Two.js constructor options change after mount.Current behavior
The React prop types accept both short aliases and Two.js renderer names:
canvas/CanvasRenderersvg/SVGRendererwebgl/WebGLRendererThe short aliases are currently passed directly to
new Two(...). Two.js expects renderer class names (or values fromTwo.Types), so a value such astype="canvas"fails withTwo[this.type] is not a constructor. The README currently demonstratestype="webgl".Additionally, the Two.js instance is constructed once. Later changes to
type,ratio,overdraw,smoothing, orautostartare not applied and do not warn.This issue does not propose restoring the removed
containerprop; the current styling API is intentional.Acceptance criteria
canvas,svg, andwebglto theirTwo.Typesvalues before construction, or remove unsupported aliases from the public type and documentation.keyremount.