Fix rerender bug with followed hashtag parent

And… somehow memoize it?
This commit is contained in:
Lim Chee Aun 2024-04-15 21:37:03 +08:00
parent 9a6364a674
commit a68dccd7cf

View file

@ -407,7 +407,8 @@ function Status({
} }
// Check followedTags // Check followedTags
const FollowedTagsParent = ({ children }) => ( const FollowedTagsParent = useCallback(
({ children }) => (
<div <div
data-state-post-id={sKey} data-state-post-id={sKey}
class="status-followed-tags" class="status-followed-tags"
@ -427,6 +428,8 @@ function Status({
</div> </div>
{children} {children}
</div> </div>
),
[sKey, instance, snapStates.statusFollowedTags[sKey]],
); );
const StatusParent = const StatusParent =
showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length