-
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
Palette not optional #1951
Palette not optional #1951
Conversation
@@ -115,7 +115,7 @@ export class ThemePage extends React.Component<any, any> { | |||
private _onColorChanged(index: number, newColor: string) { | |||
let { colors } = this.state; | |||
let color = colors[index]; | |||
let theme: ITheme = {}; | |||
let theme: Partial<IPalette> = {}; |
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.
I believe there's a bug here. Either this is a palette (in which case the theme variable should be renames) or we are in correctly creating an object to pass to loadTheme. I assumed palette, so I changed the type, but would like confirmation.
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.
Huh, you're right. Can you rename this variable to pallete
or something? Then you can just loadTheme({ pallete })
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.
Yeah, I left it that way to make sure we noticed. I'll update it
Awesome catch, sorry about that. Didn't even know about |
…/office-ui-fabric-react into palette-not-optional
…/office-ui-fabric-react into palette-not-optional
Pull request checklist
$ npm run change
Description of changes
Some recent changes to the styling package made palette and font optional, which means you'll need to null check if if you re using the strict options in Typescript. In reality, those types should always be defined. Updating the APIs that allow overriding the theme to take a Partial to make things work without making props optional.
Focus areas to test
(optional)