Giter Club home page Giter Club logo

quokka-create-react-app's Introduction

Quokka Create-React-App Sample

This example project shows Quokka configured for a create-react-app application created using v3.0.1 with all defaults.

Try Quokka on this project

To try Quokka with this project, you'll need to clone this repo and run yarn install. After installing the packages, you're ready to go.

  1. Open up src/QuokkaExample.js.
  2. Start Quokka
  3. In the example, you will see that we import src/App.js and load it into the browser DOM. We then access the component from the DOM by its class name and are outputting its innerHTML, which displays both inline in your editor and within the Quokka console.

How did we configure Quokka for this project?

Because create-react-app has a few runtime dependencies, we needed to specify some additional Quokka configuration to run project files:

  1. Install jsdom-quokka-plugin package to provide browser-like environment.
  2. Install @babel/register package to allow Quokka to run babel on imports.
yarn add jsdom-quokka-plugin @babel/register --dev
  1. Add a .quokka project file that tells Quokka to use the jsdom-quokka-plugin and to transpile your files using the react-app babel preset.

Please note: you may install the jsdom-quokka-plugin and @babel/register packages to your global quokka folder if you don't want to pollute your project's node modules. If you install globally, you will not need to add them again for subsequent projects.

To install the packages in your global quokka folder:

cd ~/.quokka
npm install jsdom-quokka-plugin @babel/register

quokka-create-react-app's People

Contributors

smcenlly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.