mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-27 00:06:55 +00:00
committed by
Nicolas Gallagher
parent
0ac406c91e
commit
781a4191f0
@@ -110,7 +110,7 @@ describe('components/View', () => {
|
|||||||
const hrefAttrs = {
|
const hrefAttrs = {
|
||||||
download: 'filename.jpg',
|
download: 'filename.jpg',
|
||||||
rel: 'nofollow',
|
rel: 'nofollow',
|
||||||
target: 'blank'
|
target: '_blank'
|
||||||
};
|
};
|
||||||
const { container } = render(<View href="https://example.com" hrefAttrs={hrefAttrs} />);
|
const { container } = render(<View href="https://example.com" hrefAttrs={hrefAttrs} />);
|
||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
|||||||
+2
-2
@@ -107,8 +107,8 @@ const View = forwardRef<ViewProps, *>((props, forwardedRef) => {
|
|||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
supportedProps.rel = rel;
|
supportedProps.rel = rel;
|
||||||
}
|
}
|
||||||
if (typeof target === 'string' && target.charAt(0) !== '_') {
|
if (typeof target === 'string') {
|
||||||
supportedProps.target = '_' + target;
|
supportedProps.target = target.charAt(0) !== '_' ? '_' + target : target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user