bug
The event gets called twice.
It should get called once. This has completely messed up our tracking analytics.
import React, { Component } from 'react';
import * as SurveyJs from 'survey-react';
const model = new SurveyJs.Model({ surveyId: "cc151__SECRET__9515805" });
class Discovery extends Component {
render () {
console.log('rendering, this gets called once');
return (
<SurveyJs.Survey
model={ model }
onCurrentPageChanged={ this.sendTrackingEvents }
/>
)
}
sendTrackingEvents = model => {
// this gets called twice for every page, even the initial page
console.log('onCurrentPageChanged', model);
}
}
export default Discovery;
This used to happen before when I was using React Router, but I am not using any router and it still happens. Here is the initial setup javascript.
import React from 'react';
import ReactDOM from 'react-dom';
import Discovery from '@/containers/Discovery';
const domNode = document.getElementById('root');
ReactDOM.render(<Discovery />, domNode);
@enricribas Indeed, I was able to reproduce the issue. We will on the fix.
Thank you,
Andrew
@enricribas It has been fixed. The fix will be available in the next minor update, in couple days.
Thank you,
Andrew
Thank you