All Projects → nosco → hx

nosco / hx

Licence: MIT license
A simple, easy to use library for React development in ClojureScript.

Programming Languages

clojure
4091 projects
HTML
75241 projects

Projects that are alternatives of or similar to hx

react-native-value-picker
Cross-Platform iOS(ish) style picker for react native.
Stars: ✭ 18 (-92.62%)
Mutual labels:  react-components, react-hooks
how-react-hooks-work
Understand how React-hook really behaves, once and for all!
Stars: ✭ 73 (-70.08%)
Mutual labels:  react-components, react-hooks
MERN-BUS-APP
This is a MFRP (My first Real Project) assigned to me during my internship at Cognizant. Made with MERN Stack technology.
Stars: ✭ 92 (-62.3%)
Mutual labels:  react-components, react-hooks
furl
Functional react.js components.
Stars: ✭ 33 (-86.48%)
Mutual labels:  react-components, react-hooks
react-use-hubspot-form
Embed HubSpot forms into your React components using hooks! Works with Create React App, Gatsby and other platforms.
Stars: ✭ 41 (-83.2%)
Mutual labels:  react-components, react-hooks
react-remark
React component and hook to use remark to render markdown
Stars: ✭ 81 (-66.8%)
Mutual labels:  react-components, react-hooks
react-admin-nest
React和Ant Design和 Nest.js 和 Mysql 构建的后台通用管理系统。持续更新。
Stars: ✭ 123 (-49.59%)
Mutual labels:  react-components, react-hooks
Nectus
A boilerplate Flask API for a Fullstack Project with some additional packages and configuration prebuilt. ⚙
Stars: ✭ 32 (-86.89%)
Mutual labels:  react-components, react-hooks
mint-ui
Design System | React UI components for web
Stars: ✭ 17 (-93.03%)
Mutual labels:  react-components, react-hooks
awesome-web-react
🚀 Awesome Web Based React 🚀 Develop online with React!
Stars: ✭ 31 (-87.3%)
Mutual labels:  react-components, react-hooks
book-fullstack-react
Fullstack React: The Complete Guide to ReactJS and Friends by Anthony Accomazzo
Stars: ✭ 100 (-59.02%)
Mutual labels:  react-components, react-hooks
React-Netflix-Clone
A Fully Responsive clone of Netflix website built using React.JS as a Front-end & Firebase as a Back-end.
Stars: ✭ 91 (-62.7%)
Mutual labels:  react-components, react-hooks
react-guidebook
📚 React 知识图谱 关于概念、技巧、生态、前沿、源码核心
Stars: ✭ 22 (-90.98%)
Mutual labels:  react-components, react-hooks
react-sample-projects
The goal of this project is to provide a set of simple samples, providing and step by step guide to start working with React.
Stars: ✭ 30 (-87.7%)
Mutual labels:  react-components, react-hooks
fluent-windows
🌈 React components that inspired by Microsoft's Fluent Design System.
Stars: ✭ 122 (-50%)
Mutual labels:  react-components, react-hooks
MetFlix
A Movie app demo. Like NetFlix ❤️
Stars: ✭ 50 (-79.51%)
Mutual labels:  react-components, react-hooks
tiny-ui
⚛️ A friendly UI component set for React.js
Stars: ✭ 202 (-17.21%)
Mutual labels:  react-components, react-hooks
Beautiful React Hooks
🔥 A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development 🔥
Stars: ✭ 5,242 (+2048.36%)
Mutual labels:  react-components, react-hooks
next-qrcode
React hooks for generating QRCode for your next React apps.
Stars: ✭ 87 (-64.34%)
Mutual labels:  react-components, react-hooks
frontend-toolbox
Frontend tools which we used in snappmarket v2
Stars: ✭ 37 (-84.84%)
Mutual labels:  react-components, react-hooks

hx

Clojars Project

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

Update - Transfer of ownership

The original author has kindly agreed to transfer ownership of this project to Nosco. We're using hx in production and don't expect any breaking changes, but we are fixing small issues and minor quality of life improvements as we find them.

Development from the original author has moved to helix. Helix is the latest version of hx, with some breaking changes (no hiccup parser, slightly different hooks API, and a focus on compile-time semantics).

Example

(ns my-app.core
  (:require [hx.react :as hx :refer [defnc]]
            [hx.hooks :as hooks]
            ["react-dom" :as react-dom]))

;; `defnc` creates a function that takes a props object and returns React
;; elements. You may use it just like any normal React component.
(defnc MyComponent [{:keys [initial-name]}]
  ;; use React Hooks for state management
  (let [[name update-name] (hooks/useState initial-name)]
    [:<>
     [:div "Hello " 
      [:span {:style {:font-weight "bold"}} name] "!"]
     [:div [:input {:on-change #(update-name (-> % .-target .-value))}]]]))

(react-dom/render
  ;; hx/f transforms Hiccup into a React element.
  ;; We only have to use it when we want to use hiccup outside of `defnc` / `defcomponent`
  (hx/f [MyComponent {:initial-name "React in CLJS"}])
  (. js/document getElementById "app"))

Dependencies

You'll want to make sure you have the latest version of react, and whatever renderer you are targeting (e.g. react-dom).

npm i react react-dom

If you want to use the React Hooks API (hx.hooks), you'll need to ensure you are using React 16.8 or later.

What problems does hx solve?

hx is meant to make it simple, easy and fun to use React.js within ClojureScript. It is your bridge to the wide world of React.js in idiomatic CLJS.

The library is split into (currently) three sections, which you can feel free to mix as your project sees fit:

  1. A hiccup interpreter. Takes in [:div {:style {:color "red"}} [:span "foo"]] and spits out React.createElement calls.

  2. Helpers for creating components. defnc and defcomponent help us write plain React.js components in idiomatic ClojureScript.

  3. Helpers for using React Hooks.

What problems does hx not solve?

No opinionated state management, no custom rendering queue. Use it to build your awesome opinionated async reactive immutable app framework. hx is just a Clojure-y interface to creating plain, unadulterated React components.

Documentation

Examples

Interop:

Projects that use it

License

Copyright © 2018 Will Acton

Distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].