• Stars
    star
    625
  • Rank 71,862 (Top 2 %)
  • Language
    Clojure
  • License
    Eclipse Public Li...
  • Created almost 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple, easy to use library for React development in ClojureScript.

Helix

ClojureScript optimized for modern React development.

(ns my-app.core
  (:require [helix.core :refer [defnc $]]
            [helix.hooks :as hooks]
            [helix.dom :as d]
            ["react-dom/client" :as rdom]))

;; define components using the `defnc` macro
(defnc greeting
  "A component which greets a user."
  [{:keys [name]}]
  ;; use helix.dom to create DOM elements
  (d/div "Hello, " (d/strong name) "!"))

(defnc app []
  (let [[state set-state] (hooks/use-state {:name "Helix User"})]
    (d/div
     (d/h1 "Welcome!")
      ;; create elements out of components
      ($ greeting {:name (:name state)})
      (d/input {:value (:name state)
                :on-change #(set-state assoc :name (.. % -target -value))}))))

;; start your app with your favorite React renderer
(defonce root (rdom/createRoot (js/document.getElementById "app")))
(.render root ($ app))

Installation

Clojars Project

Install the latest version from clojars in your project.

Install JS dependencies:

npm init # initiliaze NPM project if necessary
npm i react react-refresh # install react, and react-refresh for hot reloading support (see docs)
npm i react-dom # install renderer. alternatives could be react-native, react-three-fiber, etc.

shadow-cljs and react-native

See React Native.

lein-cljsbuild / figwheel-main / raw CLJS

Use CLJSJS or package react yourself using webpack, ensuring it is provided as the name "react".

Documentation

View formatted docs at cljdoc badge

Other resources:

License

Copyright © 2020 Will Acton

Distributed under the EPL 2.0

More Repositories

1

pyramid

A library for storing and querying graph data in Clojure
Clojure
197
star
2

punk

A data REBL built for the web
Clojure
150
star
3

cascade

A library of continuation-passing, thunk-producing versions of many Clojure core functions.
Clojure
70
star
4

flex

flex is a reactive signal library for Clojure(Script)
Clojure
67
star
5

eql-cli

A CLI for executing EQL queries on EDN data
Clojure
42
star
6

bs-most

Reason/BuckleScript bindings for the Most.js reactive toolkit
OCaml
41
star
7

observe-component

A library for accessing React component events as reactive observables
JavaScript
36
star
8

hooks-demo

Demonstration of React Hooks used in ClojureScript
Clojure
35
star
9

storybook-cljs

Example using shadow-cljs and storybook
Clojure
34
star
10

7-humble-guis

An implementation of 7 GUIs using HumbleUI
Clojure
30
star
11

apollo-cljs-example

apollo-cljs-example
Clojure
24
star
12

plum

Clojure
23
star
13

humble-starter

A starter project for developing desktop apps using HumbleUI
Clojure
23
star
14

dom

Clojure
20
star
15

reagent-context

Easy access to React context in ClojureScript & Reagent
Clojure
17
star
16

advent-2017

Advent of Code 2017
OCaml
15
star
17

thump

Clojure
14
star
18

helix-todo-mvc

Clojure
12
star
19

react-clj

Clojure
12
star
20

datascript-notes

12
star
21

serenity

Clojure
10
star
22

advent-2019

Advent of Code 2019
Clojure
10
star
23

helix-spec-alpha

Clojure
9
star
24

good-dog

A Clojure(Script) library for fetching data over HTTP(S)
Clojure
9
star
25

apollo-reagent

ClojureScript & Reagent integration for Apollo Client
Clojure
8
star
26

react-repl

A library for interacting with a live React application at a REPL.
Clojure
8
star
27

flex-old

A library for creating dynamic, incremental dataflow programs in Clojure(Script).
Clojure
7
star
28

lilac.town

Clojure
7
star
29

reason-autocomplete

An example ReasonML project
OCaml
7
star
30

exo

Clojure
7
star
31

harmony

multiversion concurrency control for JS
TypeScript
6
star
32

hx-frisk

Clojure
5
star
33

kitten

My custom Emacs configuration, based around meow
Emacs Lisp
5
star
34

clerk-mode

An Emacs minor mode for presenting Clojure files in Clerk
Emacs Lisp
4
star
35

7-flex-dom-guis

Clojure
4
star
36

punk2

Clojure
4
star
37

flex-dom

Clojure
4
star
38

habitbot

Slack bot for Habitica (formerly HabitRPG) party
JavaScript
4
star
39

solid

Clojure
3
star
40

immutable-editor

React component for live-editing Immutable.JS data
JavaScript
3
star
41

zmk-config

C
2
star
42

homebrew-brew

Ruby
2
star
43

hux

A declarative DSL for writing functional programs in javascript
TypeScript
2
star
44

react-template-server

An example system where a server (in this case Node.js + Express) serves up server-rendered React components as page templates.
JavaScript
2
star
45

clinch

React Hooks for ClojureScript
Clojure
2
star
46

bastardkb-qmk

C
2
star
47

lambda-tools

Tools for building serverless Clojure applications in AWS Lambda
Clojure
2
star
48

mim

A task runner built for Clojure
Clojure
2
star
49

advent-2022

Factor
2
star
50

advent-2020

Scheme
2
star
51

edn-tree

Clojure
2
star
52

fighweel-helix

C++
2
star
53

module-example

Clojure
2
star
54

refold

Clojure
2
star
55

shadow-cljs-const-repro

Clojure
1
star
56

clojure-lambda

Clojure
1
star
57

scaffold-web

Scaffolding for a basic web project using webpack/babel
JavaScript
1
star
58

cactus

Experimental MVI framework for React, codename "Cactus"
TypeScript
1
star
59

willacton.com

HTML
1
star
60

advent-2018

Rust
1
star
61

dataloader

Clojure
1
star
62

async-seq

Clojure
1
star
63

shadow-reagent-flip-move-example

Clojure
1
star
64

reagent-list-broken

Clojure
1
star
65

shadow-cljs-macchiato

Clojure
1
star
66

mashup

A node.js web application that generates random reddit headlines.
JavaScript
1
star
67

observable-drag-drop-example

Example of implementing drag and drop using React and observe-component
JavaScript
1
star
68

dxl

Clojure
1
star