Skip to content

Prevent Stratakit grid-level props from being passed to cards#215

Open
alexdunae wants to merge 2 commits into
mainfrom
alex/filter-stratakit-card-props
Open

Prevent Stratakit grid-level props from being passed to cards#215
alexdunae wants to merge 2 commits into
mainfrom
alex/filter-stratakit-card-props

Conversation

@alexdunae

Copy link
Copy Markdown
Contributor

Previously, props like useTileState and gridProps (which are used to build up a card's props) could be passed to Stratakit card components, triggering warnings like

React does not recognize the `useTileState` prop on a DOM element. 
If you intentionally want it to appear in the DOM as a custom attribute, 
spell it as lowercase `usetilestate` instead. If you accidentally passed it 
from a parent component, remove it from the DOM element. Error Component Stack

This PR adds a filtering function to strip out those props before actually rendering the card.

@alexdunae alexdunae marked this pull request as ready for review June 16, 2026 19:08
Comment on lines +467 to +469
const useIndividualStateResult = useTileState(props.iModel, rest);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useIndividualStateResult);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit:

Suggested change
const useIndividualStateResult = useTileState(props.iModel, rest);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useIndividualStateResult);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useTileState(props.iModel, rest););

Comment on lines +310 to +312
const useIndividualStateResult = useTileState(props.iTwin, rest);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useIndividualStateResult);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit:

Suggested change
const useIndividualStateResult = useTileState(props.iTwin, rest);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useIndividualStateResult);
const tileProps = stripNonTileProps(rest);
const tileState = stripNonTileProps(useTileState(props.iTwin, rest));

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