- React: the principles
- Declarative UI programming: don't say how to get the UI in a given state, define what you'd like the UI to be and let React do it for you
f(data) -> UI
is a React Component- Like functions components can be composed
- Create a new React R+ project with VSCode (and the R+ extension)
- First component: return JSX and R+ UI widgets in a function: the function is the component!
- R+ Layout in React: use child properties and other R+ layout idioms like you would do with BML
- Compenents can take props: parameterize our first component: map data to UI!
- Introducing state through the useState hook: we still map data to UI!
- Use any JS expression to model the UI output: conditional rendering with ternary operator and repeated rendering with
Array.prototype.map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import JsCore from "@jscore"; | |
import EventEmitter from "@jscore/event-emitter"; | |
export interface RequestHandler<T, R> { | |
(request: T, ...args: any[]): R; | |
} | |
declare const RequestRouter_base: new () => EventEmitter<{ | |
/** | |
* Fires when something happens | |
* @event | |
*/ |
OlderNewer