4

pyr7y18xq - CodeSandbox

 3 years ago
source link: https://codesandbox.io/s/pyr7y18xq
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.
pyr7y18xq - CodeSandbox
File
Edit
Selection
View
Go
Help
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 Model extends Govern.Component {
  static defaultProps = {
    defaultValue: ""
  constructor(props) {
    super(props);
    this.state = {
      value: props.defaultValue
  publish() {
    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