Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Embed Vanilla Forums in ReactJs app

Hello,

After succesfully installing the vanilla forum I am now trying to embed the forum on my ReactJs application. My plan is to route "/forum" of my app to a component that should contain a reference to my embed.js file of the Vanilla instalation.

The method that I tried is not working, could you please advise on how to embed in ReactJs app?


This is the way that I tried to embed the forum in my React component:


import * as React from 'react';

export class Forum extends React.Component {

  componentWillMount() {
     const script = document.createElement('script');
    
     script.type = 'text/javascript';
     script.src = 'http://mydomain.com:8082/js/embed.js';
     script.async = true;
    
     document.body.appendChild(script);
  }

  render() {

    return (
      <div className="vanilla-credit">
        <div className="vanilla-credit">
          <a className="vanilla-anchor" href="http://vanillaforums.com">
            Discussions by <span className="vanilla-logo">Vanilla</span>
          </a>
        </div>
      </div>
    );
  }
}

export default Forum;


Tagged:

Comments

  • Do you have any update on it matter? I'm having the same problem

Sign In or Register to comment.