Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix types #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ react-xls is the fastest in-browser excel ( .xls & .xlsx ) parser for React.
react-xls is available on npm. It can be installed with the following command:

```
npm install react-xls --save
npm install @coinsummer/react-xls --save
```

react-xls is available on yarn as well. It can be installed with the following command:

```
yarn add react-xls --save
yarn add @coinsummer/react-xls --save
```

## 💡 Usage
Expand All @@ -35,7 +35,7 @@ yarn add react-xls --save
```js
import React from 'react';

import { useExcelDownloder } from 'react-xls';
import { useExcelDownloder } from '@coinsummer/react-xls';

function App() {
const { ExcelDownloder, Type } = useExcelDownloder();
Expand Down Expand Up @@ -77,7 +77,7 @@ export default App;
```js
import React from 'react';

import { useExcelDownloder } from 'react-xls';
import { useExcelDownloder } from '@coinsummer/react-xls';

function App() {
const { ExcelDownloder, Type } = useExcelDownloder();
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "react-xls",
"version": "0.1.1",
"name": "@coinsummer/react-xls",
"version": "0.1.3",
"description": "react-xls is the fastest in-browser excel ( .xls & .xlsx ) parser for React. It is full of useful features such as useExcelDownloader, ... etc.",
"author": "Bunlong <bunlong.van@gmail.com>",
"author": "Max <winfreyu@gmail.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/Bunlong/react-xls.git"
"url": "git+https://github.com/coinsummer/react-xls.git"
},
"bugs": {
"url": "https://github.com/Bunlong/react-xls.git/issues"
"url": "https://github.com/coinsummer/react-xls.git/issues"
},
"keywords": [],
"homepage": "https://github.com/Bunlong/react-xls",
"homepage": "https://github.com/coinsummer/react-xls",
"main": "dist/react-xls.js",
"module": "dist/react-xls.es.js",
"jsnext:main": "dist/react-xls.es.js",
Expand Down
16 changes: 8 additions & 8 deletions src/useExcelDownloder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const Type = {

export interface Api {
data: any;
setData?: () => void;
setData: (data: any) => void;
filename: string;
setFilename?: () => void;
setFilename: (filename: string) => void;
type: string;
setType: () => void;
style?: any;
setStyle?: () => void;
className?: any;
setClassName?: () => void;
setType: (type: string) => void;
style: any;
setStyle: (style: any) => void;
className: any;
setClassName: (className: string) => void;
}

export interface Props {
Expand Down Expand Up @@ -100,7 +100,7 @@ function useExcelDownloderComponent(api: Api) {

export function useExcelDownloder() {
const [data, setData] = React.useState({});
const [filename, setFilename] = React.useState({});
const [filename, setFilename] = React.useState('');
const [type, setType] = React.useState(Type.Link);
const [style, setStyle] = React.useState({});
const [className, setClassName] = React.useState('');
Expand Down