Created
          October 21, 2019 14:23 
        
      - 
      
 - 
        
Save arasmussen/67057c7cf24dbaa65161eda92fb0319f to your computer and use it in GitHub Desktop.  
    Render Canny's feedback widget in ReactJS
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import PropTypes from 'prop-types'; | |
| import React, { Component } from 'react'; | |
| const BoardToken = 'YOUR_BOARD_TOKEN'; | |
| export default class CannyWidget extends Component { | |
| static contextTypes = { | |
| viewer: PropTypes.shape({ | |
| ssoToken: PropTypes.string, | |
| }), | |
| }; | |
| componentDidMount() { | |
| const { viewer: { ssoToken } } = this.context; | |
| Canny('render', { | |
| boardToken: BoardToken, | |
| basePath: '/feedback', | |
| ssoToken: ssoToken, | |
| }); | |
| } | |
| render() { | |
| return ( | |
| <div data-canny /> | |
| ); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment