All Projects β†’ mychidarko β†’ react-glass

mychidarko / react-glass

Licence: other
πŸ˜† Painless React development

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to react-glass

React Redux Boilerplate
A minimal React-Redux boilerplate with all the best practices
Stars: ✭ 799 (+6046.15%)
Mutual labels:  react-boilerplate
Easywebpack Cli
A Powerful Cross-platform Webpack CLI Tool
Stars: ✭ 110 (+746.15%)
Mutual labels:  react-boilerplate
React Native Feature Boilerplate
Feature based Architecture for developing Scalable React Native Apps πŸš€ using react, redux, sagas and hooks
Stars: ✭ 139 (+969.23%)
Mutual labels:  react-boilerplate
Silk
react app 开发cliε·₯ε…·οΌŒεŒ…ζ‹¬θ„šζ‰‹ζžΆδ»₯εŠεΌ€ε‘θ°ƒθ―•εŠŸθƒ½
Stars: ✭ 14 (+7.69%)
Mutual labels:  react-boilerplate
React Signup Verification Boilerplate
React Boilerplate - Email Sign Up with Verification, Authentication & Forgot Password
Stars: ✭ 96 (+638.46%)
Mutual labels:  react-boilerplate
Habr App
React tutorial for Habrahabr
Stars: ✭ 116 (+792.31%)
Mutual labels:  react-boilerplate
Reactprimer
React component prototyping tool that generates fully connected class component code.
Stars: ✭ 743 (+5615.38%)
Mutual labels:  react-boilerplate
Eth Hot Wallet
Ethereum wallet with erc20 support / web wallet - built using react, web3, eth-lightwallet
Stars: ✭ 205 (+1476.92%)
Mutual labels:  react-boilerplate
React Hot Loader Minimal Boilerplate
Minimal setup needed to run React Hot Loader v3
Stars: ✭ 108 (+730.77%)
Mutual labels:  react-boilerplate
React Starter Boilerplate Hmr
React starter boilerplate with React Fast Refresh, React 17 and Webpack 5
Stars: ✭ 137 (+953.85%)
Mutual labels:  react-boilerplate
React Redux Registration Login Example
React + Redux - User Registration and Login Tutorial & Example
Stars: ✭ 1,011 (+7676.92%)
Mutual labels:  react-boilerplate
React Redux Hooks Starter
React-redux boilerplate using hooks 🎣
Stars: ✭ 69 (+430.77%)
Mutual labels:  react-boilerplate
Cwg React Starter
Pre-configured and Ready to use React Starter App. To save time in settings things up for new project. Almost everything needed is already configured. Just clone and start developing without wasting time in doing same stuffs for every project. (#codewithghazi)
Stars: ✭ 122 (+838.46%)
Mutual labels:  react-boilerplate
React Boilerplate Cra Template
πŸ”₯ Setup Create React App with React Boilerplate. Highly scalable & Best DX & Performance Focused & Best practices.
Stars: ✭ 859 (+6507.69%)
Mutual labels:  react-boilerplate
React Hooks Redux Registration Login Example
React Hooks + Redux - User Registration and Login Tutorial & Example
Stars: ✭ 138 (+961.54%)
Mutual labels:  react-boilerplate
Minimal React Webpack Babel Setup
The minimal React, Webpack, Babel Setup. You want to get beyond create-react-app?
Stars: ✭ 777 (+5876.92%)
Mutual labels:  react-boilerplate
Generact
Generate React components by replicating your own
Stars: ✭ 1,471 (+11215.38%)
Mutual labels:  react-boilerplate
gatsby-starter-redux-saas
An Gatsby starter for Saas products. Uses redux and apollo and a graphql token auth backend.
Stars: ✭ 18 (+38.46%)
Mutual labels:  react-boilerplate
Analytics React
[DEPRECATED AND UNSUPPORTED] The hassle-free way to integrate analytics into your React application.
Stars: ✭ 146 (+1023.08%)
Mutual labels:  react-boilerplate
React Boilerplate
React Boilerplate
Stars: ✭ 128 (+884.62%)
Mutual labels:  react-boilerplate

React Glass

React Glass is a simple react js boilerplate which focuses on providing a simple and pain-free developer experience. If you're a fan of TypeScript, check out React Glass TS

Features

Scalable Project Structure

Although react docs say you can arrange your project in any way that feels convenient to you, there are a couple of techniques that you can emplore in your directory structure that makes scaling/working on your projects much easier. Some of these have been done by default here. Just download and you're good to go.

Glass Router (GlassRX)

Glass router has been published as an independent package. You can check it out here

Glass router is a wrapper around react-router-dom which provides a clean and developer friendly syntax and usage for your apps.

Glass router is initialized in src/routes.js. That's where you need to import your routes. Each view has a routes file in which all routes relating to that view are defined. This file is then imported in the main routes file.

import home from "./views/Home/routes";
import login from "./views/Login/routes";

const routes = [
  ...home,
  ...login,
];

Glass router is inspired by vue router and so uses the exact same syntax but includes react-router specific options like exact and render.

Route with exact prop

import Home from "./Home"

export default [
  {
    path: "/",
    exact: true,
    component: Home,
    name: "home",
  },
];

Route with render instead of component.

{
  path: "*",
  render: () => <h2>Page Not Found</h2>,
},

Routing with glass router

All routing operations can be performed on the glassrouter object no matter the component type you're using.

Just as said above, the Glass Router (GlassRX) uses a syntax fairly the same as vue-router's syntax. As such, you can simply import the router object and call the push method.

import GlassRouter from "glass-router";

return GlassRouter.push("/auth/login");

Just like vue-router, you can navigate to a route by passing an object instead like this:

return GlassRouter.push({ name: "login" });

The name here is the name given to the route when the route was defined:

{
  path: "/",
  exact: true,
  component: Home,
  name: "home",
},

Routing with the route name is a good practice, as it prevents repition and easily allows you to change the route path and not break your app in any way.

GlassRX also provides a simple way to route when using JSX, just as done with react-router

import { Link } from "glass-router";

<Link to="/home">Homepage</Link>

Unlike the base react-router link, you can also use named routes here:

<Link to={{ name: "home" }}>Homepage</Link>

Check out the glassRX repo for updates.

GlassX

One more Vue inspired feature, GlassX is a state management solution that follows a syntax close to VueX. GlassX is based on Reactn and actually uses reactn features under the hood, so after creating your glassX store, you can use useGlobal and all other reactn methods to mutate and read your global state.

For now, glassX just provides a clean way to break up your components states and reducers into seperate files and import them as modules just as done in VueX.

Both updating and reading your state require you to use directly use reactn as done in src/views/Home/Home.jsx since glassX hasn't developed those features due to performance issues.

Example state.js

const state = {
  initial: "name",
};

export default state;

Example reducer.js

export const SET_USER = (state, dispatch, payload) => ({
  user: { ...state.user, ...payload },
});

Example read and update state:

import { useGlobal } from "reactn";
import { useTitle } from "@/utils/hooks";

export default function Home() {
  useTitle("Home");

  const [something, setSomething] = useGlobal("something");

  setTimeout(() => {
    setSomething("hobies");
  }, 3000);
  ...

Checkout GlassX from it's repo.

More

There are additional readme files in sub directories which give you information about the items in that sub directory.

You can go through those files for more info about the items in there.

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].