Skip to content

Commit 5344c86

Browse files
Fix comment references and links - all credit to @aaronlademann-wf
1 parent 9949639 commit 5344c86

16 files changed

+304
-306
lines changed

example/geocodes/geocodes.dart

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,30 @@ import 'dart:html';
66
import 'package:react/react.dart' as react;
77
import 'package:react/react_dom.dart' as react_dom;
88

9-
/**
10-
* Hello,
11-
*
12-
* This is the Dart portion of the tutorial for the Dart react package.
13-
*
14-
* We'll go through a simple app that queries the Google Maps API and shows the result to the user.
15-
* It also stores the search history and allows the user to reload past queries.
16-
*
17-
* In this file you'll find the structure and the logic of the app. There is also a `geocodes.html` file which contains
18-
* the mount point.
19-
*
20-
* Be sure that you understand the basic concepts of [React](http://facebook.github.io/react/) before reading this
21-
* tutorial.
22-
*
23-
* Enjoy!
24-
*/
9+
/// Hello,
10+
///
11+
/// This is the Dart portion of the tutorial for the Dart react package.
12+
///
13+
/// We'll go through a simple app that queries the Google Maps API and shows the result to the user.
14+
/// It also stores the search history and allows the user to reload past queries.
15+
///
16+
/// In this file you'll find the structure and the logic of the app. There is also a `geocodes.html` file which contains
17+
/// the mount point.
18+
///
19+
/// Be sure that you understand the basic concepts of [React](https://reactjs.org/) before reading this
20+
/// tutorial.
21+
///
22+
/// Enjoy!
2523
2624
/// Divide your app into components and conquer!
2725
///
28-
/// This is the first custom [Component].
26+
/// This is the first custom `Component`.
2927
///
3028
/// It is just an HTML `<tr>` element displaying a single API response to the user.
3129
class _GeocodesResultItem extends react.Component {
3230
/// The only function you must implement in the custom component is [render].
3331
///
34-
/// Every [Component] has a map of properties called [Component.props]. It can be specified during creation.
32+
/// Every `Component` has a map of properties called `props`. It can be specified during creation.
3533
@override
3634
render() {
3735
return react.tr({}, [
@@ -42,12 +40,12 @@ class _GeocodesResultItem extends react.Component {
4240
}
4341
}
4442

45-
/// Now we need to tell ReactJS that our custom [Component] exists by calling [registerComponent].
43+
/// Now we need to tell ReactJS that our custom `Component` exists by calling `registerComponent`.
4644
///
4745
/// As a reward, it gives us a function, that takes the properties and returns our element. You'll see it in action
4846
/// shortly.
4947
///
50-
/// This is the only correct way to create a [Component]. Do not use the constructor!
48+
/// This is the only correct way to create a `Component`. Do not use the constructor!
5149
var geocodesResultItem = react.registerComponent(() => _GeocodesResultItem());
5250

5351
/// In this component we'll build an HTML `<table>` element full of the `<tr>` elements generated by
@@ -97,11 +95,11 @@ class _GeocodesResultList extends react.Component {
9795

9896
var geocodesResultList = react.registerComponent(() => _GeocodesResultList());
9997

100-
/// In this [Component] we'll build a search form.
98+
/// In this `Component` we'll build a search form.
10199
///
102-
/// This [Component] illustrates that:
100+
/// This `Component` illustrates that:
103101
///
104-
/// > The functions can be [Component] parameters _(handy for callbacks)_
102+
/// > The functions can be `Component` parameters _(handy for callbacks)_
105103
///
106104
/// > The DOM [Element]s can be accessed using `ref`s.
107105
class _GeocodesForm extends react.Component {
@@ -216,9 +214,9 @@ class _GeocodesHistoryList extends react.Component {
216214

217215
var geocodesHistoryList = react.registerComponent(() => _GeocodesHistoryList());
218216

219-
/// The root [Component] of our application.
217+
/// The root `Component` of our application.
220218
///
221-
/// Introduces [state]. Both [state] and [props] are valid locations to store [Component] data.
219+
/// Introduces [state]. Both [state] and [props] are valid locations to store `Component` data.
222220
///
223221
/// However, there are some key differences to note:
224222
///
@@ -228,7 +226,7 @@ var geocodesHistoryList = react.registerComponent(() => _GeocodesHistoryList());
228226
///
229227
/// > When [state] is changed, the component will re-render.
230228
///
231-
/// It's a common practice to store the application data in the [state] of the root [Component]. It will re-render
229+
/// It's a common practice to store the application data in the [state] of the root `Component`. It will re-render
232230
/// every time the state is changed. However, it is not required - you can also use normal variables and re-render
233231
/// manually if you wish.
234232
///

example/geocodes/geocodes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* In this file you'll find the mount point of the app. There is also a `geocodes.dart` file which contains the
1313
* structure and the application logic.
1414
*
15-
* Be sure that you understand the basic concepts of [React](http://facebook.github.io/react/) before reading this
15+
* Be sure that you understand the basic concepts of [React](https://reactjs.org/) before reading this
1616
* tutorial.
1717
*
1818
* Enjoy!

lib/hooks.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ void useEffect(dynamic Function() sideEffect, [List<Object> dependencies]) {
165165
///
166166
/// Learn more: <https://reactjs.org/docs/hooks-reference.html#usereducer>.
167167
class ReducerHook<TState, TAction, TInit> {
168-
/// The first item of the pair returned by [React.userReducer].
168+
/// The first item of the pair returned by [React.useReducer].
169169
TState _state;
170170

171-
/// The second item in the pair returned by [React.userReducer].
171+
/// The second item in the pair returned by [React.useReducer].
172172
void Function(TAction) _dispatch;
173173

174174
ReducerHook(TState Function(TState state, TAction action) reducer, TState initialState) {
@@ -201,7 +201,7 @@ class ReducerHook<TState, TAction, TInit> {
201201
void dispatch(TAction action) => _dispatch(action);
202202
}
203203

204-
/// Initializes state of a [DartFunctionComponent] to [initialState] and creates [dispatch] method.
204+
/// Initializes state of a [DartFunctionComponent] to [initialState] and creates a `dispatch` method.
205205
///
206206
/// __Example__:
207207
///
@@ -241,7 +241,7 @@ ReducerHook<TState, TAction, TInit> useReducer<TState, TAction, TInit>(
241241
TState Function(TState state, TAction action) reducer, TState initialState) =>
242242
ReducerHook(reducer, initialState);
243243

244-
/// Initializes state of a [DartFunctionComponent] to [init(initialArg)] and creates [dispatch] method.
244+
/// Initializes state of a [DartFunctionComponent] to `init(initialArg)` and creates `dispatch` method.
245245
///
246246
/// __Example__:
247247
///
@@ -581,7 +581,7 @@ void useImperativeHandle(dynamic ref, dynamic Function() createHandle, [List<dyn
581581
/// return isOnline;
582582
/// }
583583
///
584-
/// final FriendListItem = react.registerFunctionComponent((Map props) {
584+
/// final FriendListItem = react.registerFunctionComponent((props) {
585585
/// final isOnline = useFriendStatus(props['friend']['id']);
586586
///
587587
/// return react.li({

0 commit comments

Comments
 (0)