react-fastkit
v1.0.11
Published
A React component module with obfuscation
Readme
react-fastkit
Note: This package is under active development.
react-fastkitis a fast, opinionated toolkit for React, providing both UI components and utility functions to speed up your workflow.
Features
- UI Components: Plug-and-play components like
Button,Layout, and more. - Utilities: Useful helpers such as
formatDateandisEmailfor common tasks. - API Helpers: Effortless API calls with built-in token and backend origin management.
Installation
Install via npm:
import { callApi, setBackendOrigin,setToken } from 'react-fastkit';
React.useEffect(() => { setToken('1234567890'); setBackendOrigin('https://jsonplaceholder.typicode.com'); }, []);
const handleCallApi = async () => { setError(null); setUsers([]); try { // Fetch users from JSONPlaceholder const res = await callApi('/users', {}, false); // publicCall = true const data = await res.json(); setUsers(data); } catch (err) { setError(err.message || 'Unknown error'); } };
