Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit e49f9c2

Browse files
author
Ralph Sto. Domingo
authored
Update Immutable docs
For an hour or so I was wondering why my form validators and onSubmit function were returning undefined when accessing attributes e.g. `formObj.name`. Turns out, when using the immutable counterparts, things are returned as `Map`. Added `formObj.get('name');` so people will get a hint that it works that way.
1 parent 6e7e84c commit e49f9c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/guides/immutable.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ import {
1313
// ... other imports
1414

1515
class MyForm extends Component {
16+
onFormSubmit(formObj) {
17+
// ... access form fields e.g. formObj.get('name');
18+
}
1619
render() {
1720
return (
18-
<Form model="user">
21+
<Form model="user" onSubmit={this.onFormSubmit}>
1922
<Control model=".name" />
2023

2124
{/* ... other controls */}

0 commit comments

Comments
 (0)