diff --git a/package.json b/package.json index 0a67f55..382f989 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ }, "name": "react-api-hook-calls", "private": false, - "version": "1.0.1", + "version": "1.0.2", "type": "module", "license": "MIT", "repository": "salman15/react-api-calls", diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 2c5e2ef..0000000 --- a/src/App.css +++ /dev/null @@ -1,41 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/src/App.tsx b/src/App.tsx deleted file mode 100644 index cd20136..0000000 --- a/src/App.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import './App.css' - -function App() { - const [count, setCount] = useState(0) - - return ( -
-
- - Vite logo - - - React logo - -
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

- Click on the Vite and React logos to learn more -

-
- ) -} - -export default App diff --git a/src/assets/react.svg b/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 353aaaa..ac1a4b6 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,4 +1,4 @@ -export * from "./useDelete"; -export * from "./useGet"; -export * from "./usePost"; -export * from "./usePut"; +export { default as useDelete } from "./useDelete"; +export { default as useGet } from "./useGet"; +export { default as usePost } from "./usePost"; +export { default as usePut } from "./usePut"; diff --git a/src/index.css b/src/index.css deleted file mode 100644 index 917888c..0000000 --- a/src/index.css +++ /dev/null @@ -1,70 +0,0 @@ -:root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 24px; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} diff --git a/src/index.ts b/src/index.ts index 007f69d..36e4998 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,6 @@ export * from "./hooks"; +//import { useGet, usePost, useDelete, usePut } from "./hooks"; +// export const fetchGet = useGet; +// export const fetchPost = usePost; +// export const fetchDelete = useDelete; +// export const fetchPut = usePut; diff --git a/src/main.tsx b/src/main.tsx deleted file mode 100644 index 611e848..0000000 --- a/src/main.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' -import './index.css' - -ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - -) diff --git a/vite.config.ts b/vite.config.ts index 0df8031..9fd9ffa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,18 +5,18 @@ import react from "@vitejs/plugin-react"; export default defineConfig({ build: { lib: { - entry: path.resolve(__dirname, "src/hooks/index.ts"), + entry: path.resolve(__dirname, "src/index.ts"), name: "React api calls", - fileName: (format) => `react-api-calls.${format}.js`, + fileName: (format) => `react-api-calls.${format}.js` }, rollupOptions: { external: ["react", "react-dom"], output: { globals: { - react: "React", - }, - }, - }, + react: "React" + } + } + } }, - plugins: [react()], + plugins: [react()] });