How to use jsPsych with React.js?

323 views
Skip to first unread message

chzf...@gmail.com

unread,
Jul 30, 2018, 4:52:23 PM7/30/18
to jsPsych
Hi everyone,

I wrote a UI components with some buttons and other things with React.js, but I'm wondering how to integrate it with jsPsych?
For example, my component is called Trial with several props to be filled, like
<Trial prop_1="45" prop_2="50"/>. (prop_1 is a random number)
And there are two buttons to adjust the prop_1 to approach the prop_2, like using the first button to +1 and the second button to -1, which requires continuous recording of the events of two buttons. Is that possible for jsPsych? Is jsPsych-react doing such things?

Thanks!

Josh de Leeuw

unread,
Jul 31, 2018, 2:57:43 PM7/31/18
to chzf...@gmail.com, jsPsych
You might generate more discussion for this particular topic on GitHub. I'm not sure if the folks working on the React implementations are following this discussion group currently.

My understanding of the current implementations is that the component renders a full experiment, not an individual trial. That strategy makes sense to me, since jsPsych expects to handle any user interaction and DOM control within the experiment. You could certainly create a plugin that allows for buttons that can update some value. The jspsych-reconstruction plugin does something similar, but with key presses instead of buttons.

Cheers,
Josh


--
You received this message because you are subscribed to the Google Groups "jsPsych" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jspsych+u...@googlegroups.com.
To post to this group, send email to jsp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jspsych/f5a88372-6897-41ca-b322-23fb8abc1799%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages