mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 21:54:56 +00:00
1.5 KiB
1.5 KiB
React Hook Extraction Tasks
Component candidates
- Extract data source editor state logic into a hook.
- Component:
src/components/molecules/DataSourceEditorDialog.tsx - Why: Manages editing state, sync with props, and dependency add/remove logic in the component body.
- Proposed hook:
useDataSourceEditor(or similar) to owneditingSource,updateField, and dependency helpers, plus derived dependency lists.
- Component:
- Extract component binding dialog state into a hook.
- Component:
src/components/molecules/ComponentBindingDialog.tsx - Why: Holds editable component state and binding update handlers inline.
- Proposed hook:
useComponentBindingDialogto synceditingComponentwith props and exposeupdateBindings/handleSave.
- Component:
- Extract template export/copy/download actions into a hook.
- Component:
src/components/TemplateExplorer.tsx - Why: Clipboard interactions, blob creation, and KV export are embedded in the view component.
- Proposed hook:
useTemplateExplorerActionsto returncopyToClipboard,downloadJSON, andexportCurrentDatahandlers.
- Component:
- Extract component tree expansion state into a hook.
- Component:
src/components/molecules/ComponentTree.tsx - Why: Expansion state, “expand all,” and “collapse all” logic are in the component, but reusable across tree UIs.
- Proposed hook:
useComponentTreeExpansionto compute expandable IDs and manageexpandedIdswith expand/collapse/toggle functions.
- Component: