Skip to content

Commit

Permalink
doc(Colorful): Update document example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 29, 2022
1 parent 15d5224 commit 2953114
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions packages/color-colorful/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,27 @@ npm i @uiw/react-color-colorful

## Usage

```js
```jsx mdx:preview
import React, { useState } from 'react';
import Colorful from '@uiw/react-color-colorful';

function Demo() {
const [hex, setHex] = useState("#fff");
const [hex, setHex] = useState("#59c09a");
return (
<Colorful
color={hex}
onChange={(color) => {
setHex(color.hex);
}}
/>
<>
<Colorful
color={hex}
onChange={(color) => {
setHex(color.hexa);
}}
/>
<div style={{ background: hex, marginTop: 30, padding: 10 }}>
{hex}
</div>
</>
);
}
export default Demo;
```

## Props
Expand Down
2 changes: 1 addition & 1 deletion test/editable-input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,5 @@ it('EditableInput Input Number', async () => {
const elm = getByTitle('test');
elm.focus();
fireEvent.change(elm, { target: { value: 0.15 } });
elm.blur();
// elm.blur();
});

0 comments on commit 2953114

Please sign in to comment.