Gazebo_simulation-Frontend/node_modules/@svgr/core
Riddhi Dave f4870cd530 simulator page updates 2020-12-22 09:59:14 -05:00
..
lib React files 2020-12-21 10:29:31 -05:00
CHANGELOG.md React files 2020-12-21 10:29:31 -05:00
LICENSE React files 2020-12-21 10:29:31 -05:00
README.md React files 2020-12-21 10:29:31 -05:00
package.json simulator page updates 2020-12-22 09:59:14 -05:00

README.md

@svgr/core

Build Status version MIT License

Node API of SVGR.

npm install @svgr/core

Usage

import svgr from '@svgr/core'

const svgCode = `
<svg xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect x="10" y="10" height="100" width="100"
    style="stroke:#ff0000; fill: #0000ff"/>
</svg>
`

svgr(svgCode, { icon: true }, { componentName: 'MyComponent' }).then(jsCode => {
  console.log(jsCode)
})

Use svgr.sync(code, config, state) if you would like to use sync version.

Plugins

By default @svgr/core doesn't include svgo and prettier plugins, if you want them, you have to install them and include them in config.

svgr(svgCode, {
  plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
}).then(jsCode => {
  console.log(jsCode)
})

License

MIT