Building a Trivia App with React

I sometimes use a Trivia app at the end of my talks as a replacement for the traditional summary slide, and we have also been using Trivia games as a fun activity at different Salesforce Developer events.

In this article, I share a React version of the Trivia application. The app is written with React and ES6 (ES2015), and is built with Babel and Webpack.

Check out a hosted version here:

Make it Your Own

The questions in the example above are just placeholders. It’s easy to create your own questions:

  1. Click here to download the app
  2. Modify data.js with your own questions
    The questions are loaded this way so you can easily load index.html from the local file system (using the file:// protocol) without runnning into XHR cross origin issues. See the commented out componentDidMount in app.js for an alternative XHR implementation.
  3. Open index.html. You can just double-click index.html on your local file system: no need for a web server.

Source Code and Build Instructions

The source code is available in this repository. If you want modify the app and create you own build:

  1. Clone the repo
  2. git clone
  3. Install the dependencies
    npm install
  4. Modify the app in the /js folder
  5. Build the app
    npm run webpack	


Initially inspired by Ember Jeopardy.

  • I’m especially very proud of this because it went from idea production in a less than one day. This coming from a predominantly developer of back-end. Now i have use Trivia app very awesome and better performance. I love how react can be used by people such as myself, that don’t have superior JS skills, to pump out content marketing like this in no time.

  • Pingback: Employee Directory: Sample Application with React Native and Node.js | Christophe Coenraets()

  • anitha

    Iam new to this field & have been reading as many articles a possible to enhance my knowledge in the past few months. Of all, I find your blog posts to be the most useful (along with a couple more) & I have learnt a lot this way. Thank you so much for spending so much time in researching & writing such wonderful articles

  • Wow! How could you imagine it? It’s incredible!

  • kevin Luther

    Just discovered your blog, and I’m in LOVE with it! Amazing layout an content. Love your style, you rock!! Thanks a million and please carry on the rewarding work. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers.

    Visit : fast custom essay writers

  • kevin Luther

    Your blog inspires me every time when I read it. I love reading blogs. I don’t excite always by reading blog posts. But in your blog I find something that implies in blogging. Anyway, you’re unquestionably a great blogger and you have a skill to make your reader to keep reading your blog again and again. Keep up the magnificent work. Continue moving the people!

    Visit : fast custom essay writers

  • Ayo Adekola

    nice 1 .