Skip to content

Conversation

satya164
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling e305df5 on @satya164/tweaks into 102e55b on master.

@satya164 satya164 requested a review from zamotany August 12, 2017 11:17
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 081f1c8 on @satya164/tweaks into 102e55b on master.

LoaderComponent?:
| React$Component<*, *, *>
| ((...args: *) => React$Element<*>),
LoaderComponent?: ReactClass<*> | ((...args: *) => React.Element<*>),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use Array<*> or Array<any> better for the rest parameter.

From the docs: If you add a type annotation to a rest parameter, it must always explicitly be an Array type.

https://flow.org/en/docs/types/functions/#toc-rest-parameters

if (onFinish) onFinish(paletteWithDefaults);

this.setState({ palette: paletteWithDefaults });
this.eventEmitter.publish({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to publish before setting state, remember the issue we discussed at the office. The change is in my branch anyway, but will be good to have it here as well already 🤖

return <LoaderComponent />;
}

if (shouldRender) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we change the order? If forceRender is provided, it seems natural for me to override LoaderComponent, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just following what's in the comment in the prop types. cc @zamotany

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the docs: Does not take effect if LoaderComponent is specified!

Besides, why would you specify LoaderComponent when you would force the render anyway?

try {
failure(new Error('test'));
} catch (error) {
expect(error.message).toMatch(/MaterialPaletteProvider.*test/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not expect(error.message).toBe('Uncaught MaterialPaletteProvider exception: test') for more accuracy of what's being thrown?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blame @zamotany xD

lightVibrant: { ...localDefaults.lightVibrant, population: 0 },
});
expect(style).toEqual([{ fontSize: '14px' }, {}]);
expect(StyleSheet.flatten(style)).toEqual({ fontSize: '14px' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Didn't know about flatten 👍

@rgommezz
Copy link
Contributor

Also, we need to update the API docs to remove onInit from there

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 589b7ae on @satya164/tweaks into 102e55b on master.

Copy link
Contributor

@zamotany zamotany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we you removing onInit??

@satya164
Copy link
Member Author

@zamotany it's basically the same as when the provider mounts, so seems unnecessary

@rgommezz rgommezz merged commit 74f57f7 into master Aug 13, 2017
@rgommezz rgommezz deleted the @satya164/tweaks branch August 13, 2017 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants