Export optimized SVG from Illustrator
When you save as SVG make sure that in "CSS Properties" you have selected "Presentation Atributes".
That way you get the <style>
tag, switch to "Style Elements".
You can test your exported SVG by uploading to uploading to svg2jsx.com .