@cleanweb/react 1.1.1-beta.18 → 1.1.1-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,24 +33,25 @@ export declare class ClassComponent<TProps extends o = WeakEmptyObject, TState e
33
33
  */
34
34
  Render?: VoidFunctionComponent<{}>;
35
35
  /**
36
- * Your components JSX template. This a variable that should represent what you
37
- * would normally return from a regular function component.
36
+ * Analogous to {@link React.Component.render}. A function that returns
37
+ * your component's JSX template.
38
38
  *
39
- * Alternatively, it can be a function that returns the required JSX.
40
- * The function form is useful if your template references many nested instance members
41
- * and you would like to destructure them into more easily accessible local variables.
39
+ * You should place most logic that would usually go here
40
+ * in {@link ComponentInstance.beforeRender | `beforeRender`} instead.
41
+ * This helps to separate concerns and keep the template itself clean.
42
42
  *
43
- * Besides that, you should place all other logic in {@link ComponentInstance.beforeRender | `beforeRender`}
44
- * in order to separate concerns and keep the template itself clean.
43
+ * ******
45
44
  *
46
- * @example <caption>Using a simple JSX template</caption>
47
- * template = (
48
- * <h1>
49
- * {this.props.title}
50
- * </h1>
51
- * );
45
+ * Ideally the template method should only be concerned with defining the HTML/JSX structure of
46
+ * your component's UI. This may include destructuring nested instance members
47
+ * into more easily accessible local variables, or some simple transformation of data from props/state
48
+ * into a more appropriate format for display.
52
49
  *
53
- * @example <caption>Using a template function that returns JSX.</caption>
50
+ * ******
51
+ *
52
+ * @example < caption>Using a template function that returns JSX.</ caption>
53
+ *
54
+ * ```tsx
54
55
  * template = () => {
55
56
  * const { title } = this.props;
56
57
  *
@@ -60,8 +61,9 @@ export declare class ClassComponent<TProps extends o = WeakEmptyObject, TState e
60
61
  * </h1>
61
62
  * );
62
63
  * }
64
+ * ```
63
65
  */
64
- template?: ReactTemplate | (() => ReactTemplate);
66
+ template?: () => ReactTemplate;
65
67
  /**
66
68
  * Manually trigger a rerender of your component.
67
69
  * You should rarely ever need this. But if you are migrating
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/react",
3
- "version": "1.1.1-beta.18",
3
+ "version": "1.1.1-beta.19",
4
4
  "description": "A suite of helpers for writing cleaner React function components.",
5
5
  "engines": {
6
6
  "node": ">=18"