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

🧱 Implementing the new design system #2111

Draft
wants to merge 192 commits into
base: main
Choose a base branch
from

Conversation

ziggabyte
Copy link
Contributor

@ziggabyte ziggabyte commented Aug 26, 2024

Description

This PR is the main to-do-list of the implementation of the new Zetkin design system, designed by @theo-organism .

Items that are links are ready to be worked on, click the link to get to the issue here on gitHub.

…in either menu items or component to popover.
WULCAN and others added 4 commits October 26, 2024 13:48
Resolve a conflict in:
	.storybook/preview.js
Components should only be used in JSX.
They are intended to be called only by React.

React decides when your component function is called during rendering:
https://react.dev/reference/rules/components-and-hooks-must-be-pure#how-does-react-run-your-code

In React, you do this using JSX.
```
function BlogPost() {
  // ✅ Good: Only use components in JSX
  return <Layout><Article /></Layout>;
}
function BlogPost() {
  // 🔴 Bad: Never call them directly
  return <Layout>{Article()}</Layout>;
}
```

If a component contains Hooks, it’s easy to violate the Rules of Hooks
when components are called directly in a loop or conditionally.
https://react.dev/reference/rules/rules-of-hooks

Letting React orchestrate rendering also allows a number of benefits:

* Components become more than functions. React can augment them
  with features like local state through Hooks that are tied to
  the component's identity in the tree.
* Component types participate in reconciliation. By letting React call
  your components, you also tell it more about the conceptual structure
  of your tree. For example, when you move from rendering `<Feed>` to
  the `<Profile>` page, React won't attempt to re-use them.
* React can enhance your user experience. For example, it can let
  the browser do some work between component calls so that re-rendering
  a large component tree doesn't block the main thread.
* A better debugging story. If components are first-class citizens that
  the library is aware of, we can build rich developer tools for
  introspection in development.
* More efficient reconciliation. React can decide exactly which
  components in the tree need re-rendering and skip over the ones
  that don't. That makes your app faster and more snappy.

https://react.dev/reference/rules/react-calls-components-and-hooks#never-call-component-functions-directly

See also fd93d93
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.

10 participants