4

Govern Forms w/ <Store> - CodeSandbox

 3 years ago
source link: https://codesandbox.io/s/0ozlm2lxjl
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Govern Forms w/
File
Edit
Selection
View
Go
Help
Sandbox Info
Govern Forms w/ <Store>
govern
react
forms

Files
public
Field.js
MapDistinct.js
Model.js
index.js
package.json
External resources
Sign in to
✓Save your work✓Work from any device✓Deploy & collaborate
import * as axios from "axios";
import * as Govern from "govern";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Store, Subscribe } from "react-govern";
import { Field } from "./Field";
import { MapDistinct } from "./MapDistinct";
import { Model } from "./Model";
class RegistrationFormController extends Govern.Component {
  state = {
    request: null
  subscribe() {
    return {
      model: <RegistrationFormModel />,
      request: this.state.request
  publish() {
    return {
      ...this.subs,
      canSubmit: this.canSubmit(),
Browser
Tests
Console
Problems
React DevTools

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK