-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore: remove withSafeTypeForAs #13845
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
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f83a850:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 6a33fd5c4919b378ce306c1877aa52d384a91019 (build) |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
e3383f0 to
8ee7551
Compare
| <List styles={listStyle}> | ||
| {/* Heads up! Still render empty lists to reserve the whitespace */} | ||
| <List.Item> | ||
| <List.Item index={0}> |
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.
index is a required prop on ListItem for Children API, microsoft/fluent-ui-react#2207
Previous typings were not correct because we exported ListItemProps only:
| const ListItem: React.FC<WithAsProp<ListItemProps> & { index: number }> & |
| export default withSafeTypeForAs<typeof ListItem, ListItemProps, 'li'>(ListItem); |
|
|
||
| <p> | ||
| <Input | ||
| ref="input" |
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.
Strings can be used only for deprecated refs API: https://reactjs.org/docs/refs-and-the-dom.html#legacy-api-string-refs. But there is no such usage 🧛
| import CustomAvatar from './CustomAvatar'; | ||
| import { AcceptIcon } from '@fluentui/react-icons-northstar'; | ||
|
|
||
| const statusProps: Extendable<WithAsProp<StatusProps>> = { |
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.
There is no sense in it as as is not used inside
| hasContent: !!content, | ||
| canBeCollapsed, | ||
| as, | ||
| as: String(as), |
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.
fluentui/packages/fluentui/accessibility/src/behaviors/Accordion/accordionTitleBehavior.ts
Line 48 in 6525619
| as?: string; |
String is expected in the behavior
| /** | ||
| * A Portal allows to render children outside of their parent. | ||
| */ | ||
| const Portal: React.FC<WithAsProp<PortalProps>> & FluentComponentStaticProps<PortalProps> = props => { |
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.
Portal does not have ElementType...
| onOutsideClick?: (e: React.MouseEvent) => void; | ||
| } | ||
|
|
||
| export interface PortalState { |
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.
Oops, cruft
8ee7551 to
70c52af
Compare
…ithub.com/microsoft/fluentui into chore/no-with-safe-type-as � Conflicts: � packages/fluentui/react-northstar/src/components/Grid/Grid.tsx
| * [Treeview - JAWS doesn't narrate position for each tree item](https://github.com/FreedomScientific/VFO-standards-support/issues/338) | ||
| * [Aria compliant trees are read as empty tables](https://bugs.chromium.org/p/chromium/issues/detail?id=1048770) | ||
| */ | ||
| const Tree: ComponentWithAs<'div', TreeProps> & |
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 change from ul to div is intentional bugfix, correct?
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.
Yep, as Tree and its subcomponents render divs:
I also double checked this with @jurokapsiar and we will avoid ul/li as they are breaking markup once you add custom scrollbar or virtualization
packages/fluentui/react-northstar/src/components/Dropdown/Dropdown.tsx
Outdated
Show resolved
Hide resolved
…down.tsx Co-authored-by: Miroslav Stastny <mistastn@microsoft.com>
|
🎉 Handy links: |

Pull request checklist
$ yarn changeDescription of changes
This PR replaces
withSafeTypeForAs()calls with usage to:Focus areas to test
(optional)