SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import React, { Component, createRef } from 'react'
- const svg = `
- <svg height="100" width="100">
- <circle
- cx="50"
- cy="50"
- r="40"
- stroke="black"
- stroke-width="3"
- fill="red" />
- </svg>
- `
- class Svg extends Component {
- constructor () {
- super()
- this.domRef = createRef()
- }
- componentDidMount () {
- this.domRef.current.innerHTML = svg
- }
- render () {
- return <div ref={this.domRef}></div>
- }
- }
- export default Svg
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.