Skip to content
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

Fixed flexBasis defaulting to 0%. Fix cyclic dependency with PickerIt… #1265

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
node_modules
dist
.vscode
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: configure your global git config to ignore this: http://egorsmirnov.me/2015/05/04/global-gitignore-file.html

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
*/

import React from 'react';
import Picker from './';
import PickerItem from './PickerItem'; // Fix cyclic dependency

const PickerItemPropType = (props: Object, propName: string, componentName: string) => {
const prop = props[propName];
let error = null;
React.Children.forEach(prop, function(child) {
if (child.type !== Picker.Item) {
error = new Error('`Picker` children must be of type `Picker.Item`.');
if (child.type !== PickerItem) {
error = new Error('`Picker` children must be of type `PickerItem`.');
}
});
return error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('StyleSheet/createReactDOMStyle', () => {
display: 'flex',
flexGrow: 0,
flexShrink: 0,
flexBasis: '0%'
flexBasis: 'auto'
});
});

Expand All @@ -88,7 +88,7 @@ describe('StyleSheet/createReactDOMStyle', () => {
display: 'flex',
flexGrow: 1,
flexShrink: 1,
flexBasis: '0%'
flexBasis: 'auto'
});
});

Expand All @@ -97,7 +97,7 @@ describe('StyleSheet/createReactDOMStyle', () => {
display: 'flex',
flexGrow: 10,
flexShrink: 1,
flexBasis: '0%'
flexBasis: 'auto'
});
});

Expand Down Expand Up @@ -131,7 +131,7 @@ describe('StyleSheet/createReactDOMStyle', () => {
display: 'flex',
flexGrow: 1,
flexShrink: 2,
flexBasis: '0%'
flexBasis: 'auto'
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ const createReducer = (style, styleProps) => {
if (value > 0) {
resolvedStyle.flexGrow = value;
resolvedStyle.flexShrink = 1;
resolvedStyle.flexBasis = '0%';
resolvedStyle.flexBasis = 'auto';
} else if (value === 0) {
resolvedStyle.flexGrow = 0;
resolvedStyle.flexShrink = 0;
resolvedStyle.flexBasis = '0%';
resolvedStyle.flexBasis = 'auto';
} else if (value === -1) {
resolvedStyle.flexGrow = 0;
resolvedStyle.flexShrink = 1;
Expand Down