Add 'props.lineBreakMode' to Text

Summary:I've tested this manually, but I'm not sure how to write a test for this. Hopefully someone can help out there. The least I could do is provide a starting point for a PR to be accepted.

Additionally, I've renamed the existing `NSLineBreakMode` enum converter (inside `RCTConvert`) to use dashes in the names instead of camelcase (eg: `word-wrapping` instead of `wordWrapping`).

Fixes #6338
Closes https://github.com/facebook/react-native/pull/6339

Differential Revision: D3052391

Pulled By: nicklockwood

fb-gh-sync-id: 1536dfc139d7995095e9ee9d5f13ca86f90783c5
shipit-source-id: 1536dfc139d7995095e9ee9d5f13ca86f90783c5
This commit is contained in:
aleclarsoniv
2016-03-15 04:15:59 -07:00
committed by Facebook Github Bot 8
parent 6481e0ea6a
commit 64a09feaf7
6 changed files with 32 additions and 6 deletions

View File

@@ -231,12 +231,12 @@ NSNumber *RCTConvertMultiEnumValue(const char *typeName, NSDictionary *mapping,
}
RCT_ENUM_CONVERTER(NSLineBreakMode, (@{
@"wordWrapping": @(NSLineBreakByWordWrapping),
@"charWrapping": @(NSLineBreakByCharWrapping),
@"clipping": @(NSLineBreakByClipping),
@"truncatingHead": @(NSLineBreakByTruncatingHead),
@"truncatingTail": @(NSLineBreakByTruncatingTail),
@"truncatingMiddle": @(NSLineBreakByTruncatingMiddle),
@"word-wrapping": @(NSLineBreakByWordWrapping),
@"char-wrapping": @(NSLineBreakByCharWrapping),
@"truncating-head": @(NSLineBreakByTruncatingHead),
@"truncating-middle": @(NSLineBreakByTruncatingMiddle),
@"truncating-tail": @(NSLineBreakByTruncatingTail),
}), NSLineBreakByWordWrapping, integerValue)
RCT_ENUM_CONVERTER(NSTextAlignment, (@{