13

React/Govern - CodeSandbox

 4 years ago
source link: https://codesandbox.io/s/0y10o4977l
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.
neoserver,ios ssh client
React/Govern - CodeSandbox
File
Edit
Selection
View
Go
Help
Sandbox Info
React/Govern
A basic React/Govern project
react
govern

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,
Browser
Tests
Console
Problems
React DevTools

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK