
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fixโa new CLI tool that turns CVE alerts into safe, automated upgrades.
@thaddeusjiang/react-sortable-list
Advanced tools
Welcome to @thaddeusjiang/react-sortable-list ๐ <img alt="Version" src="https://img.shields.io/npm/v/@thaddeusjiang/react-sortab
You should focus the logics of your app, not DnD.
yarn add @thaddeusjiang/react-sortable-list
export const ItemRenderExample: React.VFC = () => {
const [items, setItems] = useState<SortableItemProps[]>([
{ id: '1', name: 'Item 1' },
{ id: '2', name: 'Item 2' },
{ id: '3', name: 'Item 3' },
]);
return (
<SortableList
items={items}
setItems={setItems}
itemRender={({ item }: ItemRenderProps) => (
<div className="w-1/2 h-10 m-8 bg-blue-400 text-center">
{item.name}
</div>
)}
/>
);
};
export const ChildrenExample: React.VFC = () => {
const [items, setItems] = useState<SortableItemProps[]>([
{ id: '1', name: 'Item 1' },
{ id: '2', name: 'Item 2' },
]);
return (
<SortableList items={items} setItems={setItems}>
{({ items }: { items: SortableItemProps[] }) => (
<>
{items.map((item: SortableItemProps) => (
<SortableItem key={item.id} id={item.id}>
{item.name}
</SortableItem>
))}
</>
)}
</SortableList>
);
};
Run inside another terminal:
yarn storybook
Then run the example inside another:
yarn link
cd example
yarn link "@thaddeusjiang/react-sortable-list"
yarn # or yarn to install dependencies
yarn start #
yarn run test
๐ค Thaddeus Jiang
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a โญ๏ธ if this project helped you!
Copyright ยฉ 2022 Thaddeus Jiang.
This project is MIT licensed.
This README was generated with โค๏ธ by readme-md-generator
FAQs
You should focus the `features` of your app, not DnD boilerplate.
We found that @thaddeusjiang/react-sortable-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fixโa new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
Weโre excited to announce a powerful new capability in Socket: historical data and enhanced analytics.