generated from arvinxx/monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: 重构并修复 setData 值时会出现的重复渲染卡死的问题
- Loading branch information
Showing
31 changed files
with
681 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/sortable-list/src/SortableItem.tsx → ...able-list/src/components/SortableItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { Action } from './Action'; | ||
export { Handle } from './Handle'; | ||
export { Remove } from './Remove'; | ||
export { Item } from './BaseItem'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { useStoreUpdater } from '../hooks/useStoreUpdater'; | ||
import type { StoreUpdaterProps } from '../types'; | ||
|
||
const StoreUpdater = (props: StoreUpdaterProps) => { | ||
useStoreUpdater(props); | ||
|
||
return null; | ||
}; | ||
|
||
export default StoreUpdater; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
|
||
import { Provider, createStore, useStoreApi } from '../store'; | ||
|
||
const StoreWrapper: FC = ({ children }) => { | ||
let isWrapped = true; | ||
|
||
try { | ||
useStoreApi(); | ||
} catch (e) { | ||
isWrapped = false; | ||
} | ||
|
||
if (isWrapped) { | ||
// we need to wrap it with a fragment because it's not allowed for children to be a ReactNode | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051 | ||
return <>{children}</>; | ||
} | ||
|
||
return <Provider createStore={createStore}>{children}</Provider>; | ||
}; | ||
|
||
export default StoreWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
a3b31f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: