1
什麼是最好的方法來生成SVG元素與多個嵌入式svg元素,並返回作爲一個反應元素? 我在尋找如下內容:React js - 動態創建SVG
let s1 = <circle cx="5" cy="5" r="10" stroke="green" strokeWidth="4" fill="blue" />;
let s2 = <circle cx="50" cy="50" r="40" stroke="green" strokeWidth="4" fill="blue" />;
let tl = s1 + s2; // Operator '+' cannot be applied to types 'Element' and 'Element'.
return <svg>{tl}</svg>;
這個''工作嗎? –
是的,但我不知道從開始的svg元素的數量。我現在正在考慮使用地圖方法... – Anton
'map'絕對有效。就像''。 –