-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support ref and element attribute #124
Support ref and element attribute #124
Conversation
receive a ref
827d151
to
b802964
Compare
/** | ||
* ラッパーであるdetails要素に付与するネイティブ要素の`id`属性。ページで固有のIDを指定 | ||
*/ | ||
id?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prop of the native element, which we had dared to define for the sake of adding explanation, is deleted.
} else { | ||
return <CenterCopmonent {...props}>{children}</CenterCopmonent>; | ||
const Element = CenterComponent as ElementType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is obvious that it is already the remaining ElementType here, since it is checked if it is a ReactElement above, but the type narrowing did not work
|
||
if (typeof (Element as unknown) !== 'string') { | ||
// eslint-disable-next-line no-console | ||
console.error('as prop only supports native elements or Box.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that a specification like as={Stack}
is made.
I can throw an error, but I don't want the application to stop working if it falls under the existing code
Box has not yet been fixed. |
Closed due to no immediate needs |
Changes
Check