Skip to content

Commit

Permalink
changed markdown-code-examples to tsx-type
Browse files Browse the repository at this point in the history
  • Loading branch information
Putzi San committed Aug 17, 2018
1 parent 05ec0d1 commit 2a88b5a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm install formik formik-fields

## Example

```typescript
```tsx
import * as React from 'react';
import { FormikFields } from 'formik-fields';
import { FormikFieldInput } from './your-custom-component';
Expand Down Expand Up @@ -49,8 +49,8 @@ export const MyForm = () => (
);
```

* [TypeScript-example on CodeSandbox](https://codesandbox.io/s/p2pzokv1mq)
* [React-JSX example on CodeSandbox](https://codesandbox.io/s/2pjyoqoolr)
- [TypeScript-example on CodeSandbox](https://codesandbox.io/s/p2pzokv1mq)
- [React-JSX example on CodeSandbox](https://codesandbox.io/s/2pjyoqoolr)

## Table of Contents

Expand All @@ -76,7 +76,7 @@ The `<FormikFields>`-Component accepts following props:

> Type: `{ [fieldName]: FieldDefinition }`
```typescript
```tsx
const formikFieldDefinition = {
name: {
initialValue: '',
Expand Down Expand Up @@ -124,7 +124,7 @@ The second callback-parameter contains all props from [Formik's render-prop-call

This project is written in TypeScript and so typings should always be up-to-date. You should always enhance the `<FormikFields>`-Component with your form-values-Interface (since [TypeScript 2.9](http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#generic-type-arguments-in-jsx-elements) you can do this inline):

```typescript
```tsx
interface MyFormValues {
email: string;
name: string;
Expand All @@ -145,7 +145,7 @@ You can use FormikFields as well as formik without TypeScript (via ES6-`import`

A minimum implementation of a `FormikFieldInput` in TypeScript could look like this:

```typescript
```tsx
import { PureComponent } from 'react';
import { FormikFieldState } from 'formik-fields';

Expand Down

0 comments on commit 2a88b5a

Please sign in to comment.