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

Revised Component types (children, ref) #877

Merged
merged 14 commits into from
May 3, 2022
Merged

Commits on Mar 7, 2022

  1. Revised Component types (children, readonly, ref)

    * Rename past `Component` type to `ComponentWithChildren`.
      Motivation: Most components don't actually support children.
      This causes a type error upon accidental passing of children /
      forces you to think about which components support children.
    * Added second parameter to `ComponentWithChildren`
      to make it easier to give a custom type for `children`
      (but still defaults to useful `JSX.Element`).
    * New `Component` type does not have automatic `children` property
      (like React's preferred `VoidFunctionalComponent`),
      offering another natural way to type `props.children`:
      `Component<{children: JSX.Element}>`.
    * `props` argument in both `Component` and `ComponentWithChildren`
      automatically cast to `readonly` (shallow one level only),
      to avoid accidental assignment to `props.foo` (usually a getter)
      while still allowing passing mutables in props.
      Add `Props<T>` helper for this transformation.
    * Add @lxsmnsyc's `Ref<T>` type so it's easy to type `props.ref`:
      `Component<{ref: Ref<Element>}>`.
      <solidjs#778 (comment)>
      Fixes solidjs#778.
    edemaine committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    ca992c6 View commit details
    Browse the repository at this point in the history
  2. Fix test

    edemaine committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    64d8af1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb8e4c9 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2022

  1. Configuration menu
    Copy the full SHA
    1449595 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2022

  1. Configuration menu
    Copy the full SHA
    72a3ed0 View commit details
    Browse the repository at this point in the history
  2. Add default types, Context.Provider require children

    Comments from Otonashi
    edemaine committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    cc37b34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b43ef31 View commit details
    Browse the repository at this point in the history
  4. Restore missing <any>

    edemaine committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    68c6253 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2022

  1. Docs typo fix

    edemaine committed Apr 28, 2022
    Configuration menu
    Copy the full SHA
    8cbd4b1 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2022

  1. Cleanup server code

    edemaine committed May 2, 2022
    Configuration menu
    Copy the full SHA
    6948a60 View commit details
    Browse the repository at this point in the history
  2. JSDoc improvements

    edemaine committed May 2, 2022
    Configuration menu
    Copy the full SHA
    222f874 View commit details
    Browse the repository at this point in the history
  3. Improve FlowProps JSDoc

    edemaine committed May 2, 2022
    Configuration menu
    Copy the full SHA
    5f36ad6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    27d708e View commit details
    Browse the repository at this point in the history

Commits on May 3, 2022

  1. Configuration menu
    Copy the full SHA
    4daf201 View commit details
    Browse the repository at this point in the history