daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component, createRef } from 'react'
  2.  
  3. const svg = `
  4.   <svg height="100" width="100">
  5.     <circle
  6.       cx="50"
  7.       cy="50"
  8.       r="40"
  9.       stroke="black"
  10.       stroke-width="3"
  11.       fill="red" />
  12.   </svg>
  13. `
  14.  
  15. class Svg extends Component {
  16.   constructor () {
  17.     super()
  18.     this.domRef = createRef()
  19.   }
  20.  
  21.   componentDidMount () {
  22.     this.domRef.current.innerHTML = svg
  23.   }
  24.  
  25.   render () {
  26.     return <div ref={this.domRef}></div>
  27.   }
  28. }
  29.  
  30. 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. OK, I Understand
 
Top