Boilerplate to get started building React-based interfaces for Crestron using CH5

Overview

Getting Started with Crestron UI

An example React component communicating with the Crestron using the Crestron-CH5 library:

); }">
import {useDigitalState, usePublishDigital} from 'hooks';

export default function ProjectorControls(_props: Props): MixedElement {
  const screenDownState = useDigitalState('23');
  const screenUpState = useDigitalState('24');

  const handleDownStateClick = usePublishDigital('23', 1000);
  const handleUpStateClick = usePublishDigital('24', 1000);

  return (
    <ButtonWrapper>
      <Button
        label="Open"
        isDisabled={screenUpState}
        onClick={handleDownStateClick}
      />
      <Button
        label="Retract"
        isDisabled={screenDownState}
        onClick={handleUpStateClick}
      />
    </ButtonWrapper>
  );
}

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn flow

Runs Flow type checker.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

If it fails to find the crcomlib package, check @crcomlib config at @crestron/ch5-crcomlib/node_modules/package.json and ensure that "types" and "main" are set properly.

package error

They should be set to:

"types": "build_bundles/cjs/@types/index.d.ts",
"main": "build_bundles/cjs/cr-com-lib.js",

yarn build:archive

Creates the ch5 binary. Run this command only after you have run yarn build.

yarn eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

You might also like...
Boilerplate-tailwind - A simple boilerplate using NextJS, Typescript, Tailwind, Jest, Storybook and more

This is a Next.js boilerplate using TailwindCSS and other cool stuff. Most of th

Small boilerplate project for building React apps with Serverless functions

Serverless + React Stack A simple, containerized project for quickly starting with Serverless and React. The goal of this project is to containerize d

This project serves as a simple boilerplate to start building an isomorphic rendering application in React and Redux.
This project serves as a simple boilerplate to start building an isomorphic rendering application in React and Redux.

Isomorphic Redux App This project serves as a simple boilerplate to start building an isomorphic rendering application in React and Redux. # Features

A universal boilerplate for building web applications w/ TypeScript, React, Redux, Server Side Rendering and more.

Vortigern Vortigern is our opinionated boilerplate for crafting universal web applications by using modern technologies like TypeScript, React and Red

Coffeehouse - Ethereum boilerplate - React components and hooks for fast building dApps
Coffeehouse - Ethereum boilerplate - React components and hooks for fast building dApps

ethereum-boilerplate React components and hooks for fast building dApps without

Boilerplate for building applications with a React frontend and a C++ gRPC backend

Boilerplate for building applications with a React frontend and a C++ gRPC backend. How To Run Backend Install Bazel Bazel is for building the backend

A boilerplate for building React libraries

React Rollup Boilerplate A boilerplate for building React libraries. Included Yarn Plug'n'Play and workspaces support ES Module system support Build p

MERN Stack Boilerplate provides starter kits for building web, desktop and mobile apps

MERN Stack Boilerplate MERN Stack Boilerplate provides starter kits for building web, desktop and mobile apps in pure JavaScript. Create New MERN App

A simple Ethereum prediction market boilerplate build on top of Moralis Web3 SDK + Ethereum Boilerplate + Chainlink + OpenZeppelin. Happy BUIIDL!

ethereum-prediction-market-boilerplate This Project is a fork of Ethereum Boilerplate and demostrates how you can build your own Ethereum Prediction M

Releases(v0.1.0)
Owner
Mukund Salia
Mukund Salia
Get started with React, Redux, and React-Router.

Deprecation Warning This project was started at the advent of the Redux ecosystem, and was intended to help users get up and running quickly. Since th

David Zukowski 10.3k Dec 23, 2022
Get started with developing emails with React Components

mjml-react-starter Get started with developing emails with React Components. This starter includes dev and build scripts to get you started with 1 com

Daphne 7 Sep 22, 2022
Dapp-core-components - A library that holds the core logic of a dapp on the Elrond Network with an example to get started easily

A library that holds the core logic of a dapp on the Elrond Network with an example to get started easily

Elrond Network 4 Jan 6, 2023
Simple React-Native boilerplate code in Typescript for getting started with a new project quickly. It has all the essentials that one would require in a project.

react-native-boilerplate-typescript Simple React-Native boilerplate code in Typescript for getting started with a new project quickly. It has all the

Numanqmr 10 Sep 10, 2022
Palo-mern-boilerplate - A MERN stack (Mongo, Express, React, Node) boilerplate to get Palowans up and running quickly.

palo MERN boilerplate A MERN stack (Mongo, Express, React, Node) boilerplate to get Palowans up and running quickly. Commands: npm install # install b

Jim 10 Oct 31, 2022
Cheatsheets for experienced React developers getting started with TypeScript

React+TypeScript Cheatsheets Cheatsheets for experienced React developers getting started with TypeScript Web docs | 中文翻译 | Español | Português | Cont

TypeScript Cheatsheets 38.7k Jan 3, 2023
Cheatsheets for experienced React developers getting started with TypeScript

React+TypeScript Cheatsheets Cheatsheets for experienced React developers getting started with TypeScript Web docs | 中文翻译 | Español | Português | Cont

Uvacoder 15 Feb 20, 2022
Solana-boilerplate - Lightweight boilerplate for Solana dapps. Allows quick building and prototyping

Solana Boilerplate Lightweight boilerplate for Solana dapps. Allows quick buildi

null 21 Nov 15, 2022
A MERN stack (Mongo, Express, React, Node) boilerplate to get Palowans up and running quickly.

Palo MERN boilerplate A MERN stack (Mongo, Express, React, Node) boilerplate to get Palowans up and running quickly on new projects. Commands: npm ins

Palo IT Singapore 10 Oct 31, 2022
TypeScript basics, Compiler & Configuration, working with Next-gen JS Code, Classes & Interfaces;

TypeScript basics, Compiler & Configuration, working with Next-gen JS Code, Classes & Interfaces; Advanced Types & TypeScript Features, Generics, Decorators; Full Project culminating this learning adventure; Working with Namespaces & Modules, Webpack & TypeScript, Third-Party Libraries & TypeScript.; React + TypeScript, NodeJS + TypeScript

Debora Schuch da Rosa 0 Dec 27, 2021