This repository was archived by the owner on Aug 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Examples
Paul Jolly edited this page Apr 16, 2017
·
45 revisions
-
Examples Showcase - contains all the following examples (found in
myitcv.io/react/examples/...
) -
Hello World (standalone) - a basic GopherJS React application generated by
reactGen -init minimal
-
hellomessage.HelloMessage
(standalone) - demonstrates the simple use of a Props type -
timer.Timer
(standalone) - demonstrates the use of a State type -
todoapp.TodoApp
(standalone) - demonstrates the use of state and event handling, but also the problems of having a non-comparable state struct type -
immtodoapp.TodoApp
(standalone) - a reimplementation oftodoapp.TodoApp
using immutable data structures -
markdowneditor.MarkdownEditor
(standalone) - demonstrates the use of an external Javascript library.
Each of these examples are separate web applications, the source for which can be found here.
The sites use various example components that can be found in sub directories beneath here.
Requires:
- A working Go installation (at least
1.7
)
First:
go get -u myitcv.io/react/examples
# amend GOPATH and PATH to use the vendored code
export GOPATH="$(go list -f '{{.Dir}}' myitcv.io/react)/_vendor:$GOPATH"
export PATH="$(go list -f '{{.Dir}}' myitcv.io/react)/_vendor/bin:$PATH"
go install github.com/gopherjs/gopherjs
cd "$(go list -f '{{.Dir}}' myitcv.io/react)/examples/sites"
gopherjs serve
Each of the sites under sites/
are now available:
- http://localhost:8080/myitcv.io/react/examples/sites/examplesshowcase/
- http://localhost:8080/myitcv.io/react/examples/sites/helloworld/
- http://localhost:8080/myitcv.io/react/examples/sites/hellomessage/
- http://localhost:8080/myitcv.io/react/examples/sites/timer/
- http://localhost:8080/myitcv.io/react/examples/sites/todoapp/
- http://localhost:8080/myitcv.io/react/examples/sites/immtodoapp/
- http://localhost:8080/myitcv.io/react/examples/sites/markdowneditor/
See here