Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove inline renderer usage from React component examples #4130

Merged
merged 13 commits into from
Feb 14, 2025

Conversation

sissbruecker
Copy link
Contributor

@github-actions github-actions bot added the Language unchecked English language and AsciiDoc formatting checks haven't been done label Feb 14, 2025
@sissbruecker sissbruecker removed the Language unchecked English language and AsciiDoc formatting checks haven't been done label Feb 14, 2025
@@ -20,15 +20,15 @@ function Example() {
{ name: 'Financials.xlsx', size: '42 MB' },
]);

const renderMenuBar = useCallback(() => <MenuBar items={items.value} theme="tertiary" />, []);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renderers that use state need to be within the component function and be memoized to only be created once.

I made some exceptions on this by putting renderers that don't use state into the component where it provides context to the code snippet.

@sissbruecker sissbruecker merged commit 76c2b1f into latest Feb 14, 2025
3 of 4 checks passed
@sissbruecker sissbruecker deleted the docs/update-react-examples branch February 14, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update React examples to not recreate renderers on each render cycle
2 participants