Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Non-flex children not supported for typescript #47

Description

@ayc92

Currently, if I do something like:

<Flexbox>
    <Flexbox flexGrow={1} />
    <Flexbox flex="0 0 45%" />
</Flexbox>

The children Flexbox elements will have display: flex even though I want them to be flex children rather than containers. This isn't a problem for regular javascript, because the propTypes aren't actually enforced, so you could just do <Flexbox display="block" /> for the child element (though even that seems really cumbersome). However, for typescript, the types are actually enforced by the compiler, and display is restricted to flex and inline-flex, so you wouldn't be able to hack around it as I showed above without a compiler error.

An unideal solution would be to not use Flexbox for children, but rather just plain elements, and then to define the flex properties for them elsewhere. However, I'd really rather just be able to use the same API as the container.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions