GithubHelp home page GithubHelp logo

iwrotesomecode / react-docs-helix Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 37 KB

React docs tutorial using ClojureScript Helix

Home Page: https://josephdumont.com/helix/

HTML 2.03% CSS 3.62% Clojure 94.35%
clojurescript react

react-docs-helix's Introduction

React Docs in ClojureScript Helix

Worked examples from the (beta) React Docs using Helix, a modern and optimized library for React development in ClojureScript.

Minimal deployed example in Helix here.

part1.cljs

Quick Start Creating basic components, conditional rendering, basic click events, useState and state placement.

part2.cljs

Thinking in React Breaking the UI into component hierarchy, filter and map data within an interactive display.

part3.cljs

Describing the UI Configuring component attributes, passing props, conditional rendering, using map/filter with lists.

part4.cljs

Adding Interactivity Responding to user events.

part5.cljs

Managing State Sharing state between components: useContext, useReducer.

part6.cljs

Escape Hatches Synchronizing components with systems outside React: useRef, forwardRef, useEffect, custom hooks. Dealing with race conditions and outdated API calls.

TODO

  • More custom hook examples in the final subsections of "Escape Hatches"
  • Example of useSyncExternalStore
  • Replace main.css with Tailwindcss

Tooling

helix

Clojars Project

shadow-cljs

npm Clojars Project

promesa

promise/future library to simulate API calls with delays (e.g. fetch-data in part6.cljs)

Clojars Project

Quickstart

With these requirements installed on your system:

  • node.js (v6.0.0+, most recent version preferred)
  • npm (comes bundled with node.js) or yarn
  • Java SDK (Version 11+, Latest LTS Version recommended)

Run the following commands to setup a new project:

npx create-cljs-project <project-name>
cd <project-name> 
npm install react react-refresh react-dom 

Where <project-name> is react-docs-helix in this project.

Check the shadow-cljs docs to setup shadow-cljs.edn for your project (or copy the template here). Then you can interactively watch your app refresh as you develop it.

npx shadow-cljs watch app

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.