import React, {
  Component
} from 'react';

import {
  Field
} from '@alicloud/console-components';
import {
  H3
} from '@alicloud/demo-rc-elements';

import {
  IFieldValues
} from '../types';
import WithField from '../with-field';

export default class TestingCreate extends Component {
  field = Field.create<IFieldValues>(this, {
    values: {
      str: 'in class',
      num: 11,
      bool: true
    }
  });
  
  render(): JSX.Element {
    return <>
      <H3>使用 <code>Field.create</code> 代替 <code>new Field</code></H3>
      <WithField field={this.field} />
    </>;
  }
}
