Skip to content

Conversation

@satya164
Copy link
Member

No description provided.

@satya164 satya164 force-pushed the @satya164/optional-icon branch 2 times, most recently from 2e4e9d8 to baa83f3 Compare April 18, 2018 13:21
@callstack-bot
Copy link

callstack-bot commented Apr 18, 2018

Hey @satya164, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@satya164 satya164 force-pushed the @satya164/optional-icon branch from baa83f3 to bfb5d36 Compare April 18, 2018 13:24
const Icon = ({ name, ...props }: Props) => {
if (typeof name === 'string') {
return <MaterialIcons {...props} name={name} />;
return MaterialIcons ? <MaterialIcons {...props} name={name} /> : null;
Copy link
Member

Choose a reason for hiding this comment

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

What about adding a warning? Something like:

const error = Error(); // for stack trace error.message = 'Prop "name" was passed to <Icon /> component, but `react-native-vector-icons` is not present in your dependencies. To remove this warning don't pass "name" to <Icon /> or install `react-native-vector-icons`. console.warn(error)
@satya164 satya164 force-pushed the @satya164/optional-icon branch 2 times, most recently from 10cef0b to 39444df Compare April 18, 2018 13:39
@satya164 satya164 force-pushed the @satya164/optional-icon branch from 39444df to 58f58a8 Compare April 19, 2018 09:59
@satya164 satya164 merged commit 7018472 into master Apr 19, 2018
@satya164 satya164 deleted the @satya164/optional-icon branch April 19, 2018 13:46
@thymikee
Copy link
Member

Awesome DX work @satya164!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants