Skip to content

Commit

Permalink
Update React example to use Component.driver syntax (krakenjs#224)
Browse files Browse the repository at this point in the history
This updates the React example snippet to match the example on `docs/api.md`. I don't believe that Zoid has a `react` property on the Component instance anymore, so this updates it to use `Component.driver` and specifies react as the framework.
  • Loading branch information
copperwall authored and Daniel Brain committed Apr 8, 2019
1 parent b3c9697 commit dbb9b28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,17 @@ set up bindings for these frameworks:

Drop the component in any `render()` method:

```javascript
let MyReactLoginComponent = MyLoginComponent.driver('react', {
React: React,
ReactDOM: ReactDOM
});
```

```javascript
render: function() {
return (
<MyLoginComponent.react prefilledEmail='[email protected]' onLogin={onLogin} />
<MyReactLoginComponent prefilledEmail='[email protected]' onLogin={onLogin} />
);
}
```
Expand Down

0 comments on commit dbb9b28

Please sign in to comment.