-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
chore: remove withSafeTypeForAs #13845
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Make __PRIVATE_PROPS optional to avoid assignment requirement", | ||
"packageName": "@fluentui/react-compose", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch", | ||
"date": "2020-06-29T19:47:56.765Z" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ const dataRecordToListItem = record => ({ | |
// ---------------------------------------- | ||
// Prototype Search Page View | ||
// ---------------------------------------- | ||
class SearchPage extends React.Component<SearchPageState, any> { | ||
class SearchPage extends React.Component<any, SearchPageState> { | ||
state = { loading: false, query: '', results: [] }; | ||
searchTimer: any; | ||
|
||
|
@@ -81,7 +81,6 @@ class SearchPage extends React.Component<SearchPageState, any> { | |
|
||
<p> | ||
<Input | ||
ref="input" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 🧛 |
||
value={query} | ||
placeholder={`Try "${_.sample(DATA_RECORDS).firstName}"`} | ||
icon={loading ? <Loader size="small" /> : <SearchIcon />} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { Flex, StatusProps, WithAsProp, Extendable, Text } from '@fluentui/react-northstar'; | ||
import { Flex, StatusProps, Extendable, Text } from '@fluentui/react-northstar'; | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. There is no sense in it as |
||
const statusProps: Extendable<StatusProps> = { | ||
icon: <AcceptIcon />, | ||
state: 'success', | ||
title: 'Available', | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -15,15 +15,20 @@ import { | |||
rtlTextContainer, | ||||
} from '../../utils'; | ||||
import { | ||||
WithAsProp, | ||||
ComponentEventHandler, | ||||
ShorthandValue, | ||||
withSafeTypeForAs, | ||||
FluentComponentStaticProps, | ||||
ProviderContextPrepared, | ||||
} from '../../types'; | ||||
import Box, { BoxProps } from '../Box/Box'; | ||||
import { getElementType, useTelemetry, useUnhandledProps, useAccessibility, useStyles } from '@fluentui/react-bindings'; | ||||
import { | ||||
ComponentWithAs, | ||||
getElementType, | ||||
useTelemetry, | ||||
useUnhandledProps, | ||||
useAccessibility, | ||||
useStyles, | ||||
} from '@fluentui/react-bindings'; | ||||
// @ts-ignore | ||||
import { ThemeContext } from 'react-fela'; | ||||
|
||||
|
@@ -89,7 +94,10 @@ export type AccordionTitleStylesProps = Required<Pick<AccordionTitleProps, 'disa | |||
content: boolean; | ||||
}; | ||||
|
||||
const AccordionTitle: React.FC<WithAsProp<AccordionTitleProps>> & | ||||
/** | ||||
* An AccordionTitle represents the title of Accordion's item that can be interacted with to expand or collapse the item's content. | ||||
*/ | ||||
const AccordionTitle: ComponentWithAs<'dt', AccordionTitleProps> & | ||||
FluentComponentStaticProps<AccordionTitleProps> = props => { | ||||
const context: ProviderContextPrepared = React.useContext(ThemeContext); | ||||
const { setStart, setEnd } = useTelemetry(AccordionTitle.displayName, context.telemetry); | ||||
|
@@ -126,7 +134,7 @@ const AccordionTitle: React.FC<WithAsProp<AccordionTitleProps>> & | |||
mapPropsToBehavior: () => ({ | ||||
hasContent: !!content, | ||||
canBeCollapsed, | ||||
as, | ||||
as: String(as), | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
String is expected in the behavior |
||||
active, | ||||
disabled, | ||||
accordionContentId, | ||||
|
@@ -248,7 +256,4 @@ AccordionTitle.defaultProps = { | |||
|
||||
AccordionTitle.create = createShorthandFactory({ Component: AccordionTitle, mappedProp: 'content' }); | ||||
|
||||
/** | ||||
* An AccordionTitle represents the title of Accordion's item that can be interacted with to expand or collapse the item's content. | ||||
*/ | ||||
export default withSafeTypeForAs<typeof AccordionTitle, AccordionTitleProps>(AccordionTitle); | ||||
export default AccordionTitle; |
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 onListItem
for Children API, microsoft/fluent-ui-react#2207Previous typings were not correct because we exported
ListItemProps
only:fluentui/packages/fluentui/react-northstar/src/components/List/ListItem.tsx
Line 92 in c460107
fluentui/packages/fluentui/react-northstar/src/components/List/ListItem.tsx
Line 287 in c460107