4

vv09or2853 - CodeSandbox

 3 years ago
source link: https://codesandbox.io/s/vv09or2853
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.
vv09or2853 - CodeSandbox
Files
public
index.js
package.json
External resources
Sign in to
✓Save your work✓Work from any device✓Deploy & collaborate
import * as Govern from "govern";
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Subscribe } from "react-govern";
class FieldModel extends Govern.Component {
  static defaultProps = {
    defaultValue: ""
  constructor(props) {
    super(props);
    this.state = {
      value: props.defaultValue
  render() {
    let value = this.state.value;
    let error = this.props.validate ? this.props.validate(value) : null;
    return {
      value: this.state.value,
      error: error,

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK