You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Javascript/TypeScript side, you need to use this props within your component
189
+
```js
190
+
// Define component props
191
+
exportinterfaceIComponentProps {
192
+
// new props matching F# ComponentProps definition
193
+
getState : ((date : Date) => void)
194
+
...
195
+
}
196
+
197
+
// within JS/TS event handler use your props function
198
+
private_onSelectDate(date:Date):void {
199
+
this.props.getState(date)
200
+
...
201
+
}
202
+
```
203
+
157
204
## Importing using a Pojo (plain old JS object) record
158
205
159
206
The Pojo import is similar to the approach above, but instead of declaring a DU you create a [Pojo record](http://fable.io/docs/interacting.html#plain-old-javascript-objects). Using a record with the Pojo attribute to express the props looks more like idiomatic F# code but it can be unwieldy if you have a lot of optional props. Since this is common with React components, using the DU approach above can often be more convenient.
0 commit comments