Building the lib
docker-compose up -d --force-recreate rps-compiler &&\docker exec -it rps-compiler sh -c 'npm install && npm run build' &&\docker-compose stop rps-compiler
It will generate the transpiled javascript at build folder
Examples
State callback
Router;
State contract
title: '' // page title path: '' // push state path page: null // page to be render when pushstate is false in Link tag pathVar: 1 'b' // group values in path query: URLSearchParams // query string object
Link
If you just want to transitate from a page to another without use pushstate
what you want to render?} href="/some/path" >Some link
Using pushstate
Some link
Creating a page that loads the post information and have a permanent link to be acessed anywhere
; Component { super; thisstate = {} Router } { Routerstart; // load the state at page load } { return <div className="container"> <Link title="Home" href="/posts/1/" >Post 1</Link> <div style=background: "#F2F2F2" minHeight: 100 marginTop: 20> thisstatepage </div> </div> }
Page that just load another page without change URL and lost the state when page reloads
; Component { super; thisstate = {}; Router; } /** * This method will be called when a Link without pushState was clicked, then you will receive in state.page a page to render */ { console; this; } { Routerstart; // load the state at page load } { return <div className="container"> <Link title="Home" href="/posts/1/" >Post 1</Link> <Link pushstate="false" page=<p>JSON</p> href="/users/" + vname >vname</Link> <div style=background: "#F2F2F2" minHeight: 100 marginTop: 20> thisstatepage </div> </div> }