Skip to content

Conversation

ToMESSKa
Copy link
Contributor

@ToMESSKa ToMESSKa commented Sep 17, 2025

INSTUI-4688

ISSUE:

  • including an optional Option (e.g.: {someBool && renderAnOption()}) as child of DrillDown.Page now result in type error

TEST PLAN:

  • open the brach locally
  • create the file with the code below in your InstUI codebase
  • {someBool && renderAnOption()}) or {someBool ? renderAnOption() : null} should not get a TypeScipt type error in your IDE
import React from 'react'
import Drilldown from '.'
import { createRoot } from 'react-dom/client'

const Example = () => {
  const [someBool] = React.useState(true)

  const renderAnOption = () => (
    <Drilldown.Option id="conditionalOption">
      Conditional Option
    </Drilldown.Option>
  )

  return (
    <Drilldown rootPageId="root" width="20rem" maxHeight="30rem">
      <Drilldown.Page id="root">
        <Drilldown.Option id="option1">Option</Drilldown.Option>
        <Drilldown.Option id="option2">
        </Drilldown.Option >
        {someBool && renderAnOption()}


        <Drilldown.Option id="option3">Option</Drilldown.Option>
        <Drilldown.Option id="option4" disabled>
          Option
        </Drilldown.Option>
      </Drilldown.Page>
    </Drilldown>
  )
}

const container = document.getElementById('app');
if (container) {
  const root = createRoot(container);
  root.render(<Example />);
}

Copy link

github-actions bot commented Sep 17, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-10-01 09:59 UTC

@ToMESSKa ToMESSKa self-assigned this Sep 17, 2025
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

looks good

@ToMESSKa ToMESSKa merged commit 18f6a06 into master Oct 1, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4688-difficulty-in-optionally-including-a-drilldown-option branch October 1, 2025 09:59
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.

3 participants