Skip to content

Commit fbbe66c

Browse files
- update godoc comments
1 parent e554583 commit fbbe66c

File tree

8 files changed

+116
-15
lines changed

8 files changed

+116
-15
lines changed

elements/elements.go

Lines changed: 92 additions & 0 deletions
Large diffs are not rendered by default.

examples/event_handling/events_handling_def.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/rocketlaunchr/react/elements"
77
)
88

9+
// EventsComponent is a react component.
910
var EventsComponent *js.Object
1011

1112
type eventsState struct {

examples/event_handling/title_def.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import (
66
"github.com/rocketlaunchr/react/elements"
77
)
88

9+
// TitleComponent is a react component.
910
var TitleComponent *js.Object
1011

12+
// TitleProps are the props for TitleComponent.
1113
type TitleProps struct {
1214
Title string `react:"title"`
1315
}

examples/uptime/container_def.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import (
77
"github.com/rocketlaunchr/react"
88
)
99

10+
// ContainerComponent is a react component.
1011
var ContainerComponent *js.Object
1112

13+
// ContainerProps are the props for ContainerComponent.
1214
type ContainerProps struct {
1315
Title string `react:"title"`
1416
}

examples/uptime/timer_def.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ import (
99
"github.com/rocketlaunchr/react/elements"
1010
)
1111

12+
// TimerComponent is a react component.
1213
var TimerComponent *js.Object
1314

15+
// TimerProps are the props for TimerComponent.
1416
type TimerProps struct {
1517
// We will pass in the time when the component was first instantiated.
1618
StartTime int64 `react:"start"`
1719
}
1820

21+
// TimerState is the state for TimerComponent.
1922
type TimerState struct {
2023
// Elapsed will record how much time has passed since instantiation.
2124
Elapsed int64 `react:"elapsed"`

examples/uptime/title_def.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import (
66
"github.com/rocketlaunchr/react/elements"
77
)
88

9+
// TitleComponent is a react component.
910
var TitleComponent *js.Object
1011

12+
// TitleProps are the props for TitleComponent.
1113
type TitleProps struct {
1214
Title string `react:"title"`
1315
}

react.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var (
1212
// if it is not in your global namespace.
1313
//
1414
// See: https://www.npmjs.com/package/react
15-
1615
React = js.Global.Get("React")
1716

1817
// ReactDOM points to the ReactDOM library. Change it

react_events.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ type SyntheticEvent struct {
1414
O *js.Object
1515
}
1616

17-
// Bubbles
17+
// Bubbles ...
1818
//
1919
// See: https://reactjs.org/docs/events.html#overview
2020
func (s *SyntheticEvent) Bubbles() bool {
2121
return s.O.Get("bubbles").Bool()
2222
}
2323

24-
// Cancelable
24+
// Cancelable ...
2525
//
2626
// See: https://reactjs.org/docs/events.html#overview
2727
func (s *SyntheticEvent) Cancelable() bool {
2828
return s.O.Get("cancelable").Bool()
2929
}
3030

31-
// CurrentTarget
31+
// CurrentTarget ...
3232
//
3333
// See: https://reactjs.org/docs/events.html#overview
3434
//
@@ -41,28 +41,28 @@ func (s *SyntheticEvent) CurrentTarget() *js.Object {
4141
return s.O.Get("currentTarget")
4242
}
4343

44-
// DefaultPrevented
44+
// DefaultPrevented ...
4545
//
4646
// See: https://reactjs.org/docs/events.html#overview
4747
func (s *SyntheticEvent) DefaultPrevented() bool {
4848
return s.O.Get("defaultPrevented").Bool()
4949
}
5050

51-
// EventPhase
51+
// EventPhase ...
5252
//
5353
// See: https://reactjs.org/docs/events.html#overview
5454
func (s *SyntheticEvent) EventPhase() int {
5555
return s.O.Get("eventPhase").Int()
5656
}
5757

58-
// IsTrusted
58+
// IsTrusted ...
5959
//
6060
// See: https://reactjs.org/docs/events.html#overview
6161
func (s *SyntheticEvent) IsTrusted() bool {
6262
return s.O.Get("isTrusted").Bool()
6363
}
6464

65-
// NativeEvents
65+
// NativeEvents ...
6666
//
6767
// See: https://reactjs.org/docs/events.html#overview
6868
//
@@ -75,34 +75,34 @@ func (s *SyntheticEvent) NativeEvent() *js.Object {
7575
return s.O.Get("nativeEvent")
7676
}
7777

78-
// PreventDefault
78+
// PreventDefault ...
7979
//
8080
// See: https://reactjs.org/docs/events.html#overview
8181
func (s *SyntheticEvent) PreventDefault() {
8282
s.O.Call("preventDefault")
8383
}
8484

85-
// IsDefaultPrevented
85+
// IsDefaultPrevented ...
8686
// See: https://reactjs.org/docs/events.html#overview
8787
func (s *SyntheticEvent) IsDefaultPrevented() bool {
8888
return s.O.Call("isDefaultPrevented").Bool()
8989
}
9090

91-
// StopPropagation
91+
// StopPropagation ...
9292
//
9393
// See: https://reactjs.org/docs/events.html#overview
9494
func (s *SyntheticEvent) StopPropagation() {
9595
s.O.Call("stopPropagation")
9696
}
9797

98-
// IsPropagationStopped
98+
// IsPropagationStopped ...
9999
//
100100
// See: https://reactjs.org/docs/events.html#overview
101101
func (s *SyntheticEvent) IsPropagationStopped() bool {
102102
return s.O.Call("isPropagationStopped").Bool()
103103
}
104104

105-
// Target
105+
// Target ...
106106
//
107107
// See: https://reactjs.org/docs/events.html#overview
108108
//
@@ -115,14 +115,14 @@ func (s *SyntheticEvent) Target() *js.Object {
115115
return s.O.Get("target")
116116
}
117117

118-
// TimeStamp
118+
// TimeStamp ...
119119
//
120120
// See: https://reactjs.org/docs/events.html#overview
121121
func (s *SyntheticEvent) TimeStamp() float64 {
122122
return s.O.Get("timeStamp").Float()
123123
}
124124

125-
// Type
125+
// Type ...
126126
//
127127
// See: https://reactjs.org/docs/events.html#overview
128128
func (s *SyntheticEvent) Type() string {

0 commit comments

Comments
 (0)