Skip to content

Commit

Permalink
feat: transient props
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSeage committed Sep 1, 2022
1 parent dc8835d commit d79a9cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ function handle<K extends IntrinsicElementsKeys>(Tag: K, tagParams: TagParams, d

classNames.push($(eachNewTagParam[0], ...newParams));
}

const newProps: Record<string, any> = {};
for (const key in props) {
if (!key.startsWith('$')) {
newProps[key] = props[key];
}
}

//@ts-ignore
return <Tag ref={ref} {...props} className={$(classNames, props.className)} />;
return <Tag ref={ref} {...newProps} className={$(classNames, props.className)} />;
}) as MasterExoticComponent<K>;

component.displayName = displayName;
Expand Down

0 comments on commit d79a9cd

Please sign in to comment.