mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-23 14:13:21 +01:00
Fix rerender bug with followed hashtag parent
And… somehow memoize it?
This commit is contained in:
parent
9a6364a674
commit
a68dccd7cf
1 changed files with 22 additions and 19 deletions
|
@ -407,26 +407,29 @@ function Status({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check followedTags
|
// Check followedTags
|
||||||
const FollowedTagsParent = ({ children }) => (
|
const FollowedTagsParent = useCallback(
|
||||||
<div
|
({ children }) => (
|
||||||
data-state-post-id={sKey}
|
<div
|
||||||
class="status-followed-tags"
|
data-state-post-id={sKey}
|
||||||
onMouseEnter={debugHover}
|
class="status-followed-tags"
|
||||||
>
|
onMouseEnter={debugHover}
|
||||||
<div class="status-pre-meta">
|
>
|
||||||
<Icon icon="hashtag" size="l" />{' '}
|
<div class="status-pre-meta">
|
||||||
{snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (
|
<Icon icon="hashtag" size="l" />{' '}
|
||||||
<Link
|
{snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (
|
||||||
key={tag}
|
<Link
|
||||||
to={instance ? `/${instance}/t/${tag}` : `/t/${tag}`}
|
key={tag}
|
||||||
class="status-followed-tag-item"
|
to={instance ? `/${instance}/t/${tag}` : `/t/${tag}`}
|
||||||
>
|
class="status-followed-tag-item"
|
||||||
{tag}
|
>
|
||||||
</Link>
|
{tag}
|
||||||
))}
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{children}
|
||||||
</div>
|
</div>
|
||||||
{children}
|
),
|
||||||
</div>
|
[sKey, instance, snapStates.statusFollowedTags[sKey]],
|
||||||
);
|
);
|
||||||
const StatusParent =
|
const StatusParent =
|
||||||
showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length
|
showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length
|
||||||
|
|
Loading…
Add table
Reference in a new issue