DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Building a Trivia App With React

Building a Trivia App With React

Check out this Jeopardy-like trivia app built using React, ES6, Babel, and Webpack.

Christophe Coenraets user avatar by
Christophe Coenraets
·
Aug. 16, 16 · Web Dev Zone · Tutorial
Like (5)
Save
Tweet
8.07K Views

Join the DZone community and get the full member experience.

Join For Free

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 was written with react and es6 (es2015), and was built with babel and webpack .

check out a hosted version here: https://ccoenraets.github.io/react-trivia/

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 running 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 to modify the app and create your own build:

1 - clone the repo

git clone https://github.com/ccoenraets/react-trivia

2 - install dependencies

npm install

3 - modify the app in the /js folder

4 - build the app

npm run webpack 

credits

initially inspired by ember jeopardy .

app React (JavaScript library)

Published at DZone with permission of Christophe Coenraets. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Leverage Speech-to-Text With Node.js
  • Monitoring at the Edge of the Third Act of the Internet
  • API Security Weekly: Issue 173
  • Selenium vs Cypress: Does Cypress Replace Selenium?

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo