Skip to content

Instantly share code, notes, and snippets.

View arman94's full-sized avatar
🏠
Working from home

Arman arman94

🏠
Working from home
View GitHub Profile
@arman94
arman94 / shadcn-ui react-select.jsx
Created September 4, 2024 12:47 — forked from ilkou/shadcn-ui react-select.jsx
react-select with shadcn/ui
/* ----------- simple-select.js ----------- */
import * as React from 'react';
import Select from 'react-select';
import type { Props } from 'react-select';
import { defaultClassNames, defaultStyles } from './helper';
import {
ClearIndicator,
DropdownIndicator,
MultiValueRemove,
Option
/*
these are all issues i found in the main code:
1. all the children in Suspense component must be lazy-loaded
2. Suspense component should receive a fall-back component
3. Using useEffect hook in a component along side Suspense cause the race condition. Api call must be moved
in to parent component
*/
import { Suspense, useState, useEffect, lazy } from 'react';
@arman94
arman94 / .block
Created May 27, 2019 20:28
basic grid and axes
license: mit