Streaming live at 10am (PST)

Trying to load Webflow.js in React and Meteor


#1

Hi,

I am trying to load webflow.read() and webflow.destroy() in my routing.jsx file so that my files can keep the animation when linking between pages.

function initiateWebflow() {
  <script src="./js/webflow.js" 
type="text/JavaScript">
</script>
  webflow.ready();
}

function reInitiateWebflow() {
  // $.('./js/webflow.js');
  <script src="./js/webflow.js" 
type="text/JavaScript">
</script>
  webflow.destroy();
}

Meteor.startup( () => {
  render(
    <Router history={ browserHistory }>
      <Route path="/" component={ App } 
onEnter={initiateWebflow} 
onLeave={reInitiateWebflow}/>
      <Route path="/login" component={ Login } 
onEnter={initiateWebflow} 
onLeave={reInitiateWebflow}/>
    </Router>,
    document.getElementById( 'react-root' )
  );
});

#2

Hi @wwaldbu, what is your question?

I suggest hiring a React/Meteor developer if you need help. The community here are mostly designers and will not be of much help regarding external app coding/integration.

This does not look like valid JavaScript by the way. I suggest learning how to use debugging tools to figure out what is going wrong, and to Google the errors so that you will be able to learn how to code.

function initiateWebflow() {
  <script src="./js/webflow.js" 
type="text/JavaScript">
</script>
  webflow.ready();
}

function reInitiateWebflow() {
  // $.('./js/webflow.js');
  <script src="./js/webflow.js" 
type="text/JavaScript">
</script>
  webflow.destroy();
}