vaderjs 1.3.3-alpha-44 → 1.3.3-alpha-46

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.
package/README.md CHANGED
@@ -74,12 +74,14 @@ For pages that have [params] you can derive it using this.request
74
74
 
75
75
  ### Simplified Component Creation
76
76
 
77
+ Class based components
78
+
77
79
  ```jsx
78
80
  // pages/home.jsx
79
81
  import {Component, useState, useRef} = from 'vaderjs/client'
80
82
  import Mycomponent from './src/mycomponent.jsx'
81
83
 
82
- class Home extends Vader {
84
+ export default class extends Component {
83
85
  constructor() {
84
86
  super();
85
87
  this.key = '2'
@@ -94,9 +96,24 @@ class Home extends Vader {
94
96
  }
95
97
  }
96
98
 
97
- export default Home
99
+
100
+
98
101
  ```
99
102
 
103
+ Function based components
104
+
105
+ ```jsx
106
+ import Mycomponent from './src/mycomponent.jsx'
107
+ export default function(props){
108
+ this.key = ''
109
+ console.log(this) // returns the component object data
110
+ return <>
111
+ <h1>hello world</>
112
+ <Mycomponent ...props />
113
+ </>
114
+ }
115
+
116
+ ```
100
117
 
101
118
 
102
119
  ### State Management