Skip to content

Instantly share code, notes, and snippets.

@TrekSoft
Last active February 10, 2022 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TrekSoft/ea128c09715f81a07466dd89aceb4477 to your computer and use it in GitHub Desktop.
Save TrekSoft/ea128c09715f81a07466dd89aceb4477 to your computer and use it in GitHub Desktop.
Footer UI rendering function
const renderFooter = useCallback(
(isActive: Boolean) => {
return (
<div data-testid={isActive ? 'footer-container-id' : ''}>
<Button
disabled={!isActive || normalButtonDisableCondition}
dataTestId={isActive ? 'footer-button-id' : null}
>
Footer Action Text
</Button>
</div>
);
},
[normalButtonDisableCondition]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment