-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add UNSAFE documentation to mobile Button and Text (#2392)
* start to update Button Docs regarding UNSAFE in mobile component * update Button Implement tab with UNSAFE info * remove UNSAFE example from mobile Button story * add Text Implement tab with UNSAFE docs * update prop description to no longer link to storybook * update prop description to no longer link to storybook in Button, Text, Popover * show inline styles example * reference correct component Co-authored-by: Nazarii L <[email protected]> * re add links to prop description * update prop description * update Popover UNSAFE prop description * update UNSAFE_classname in popover --------- Co-authored-by: Nazarii L <[email protected]>
- Loading branch information
1 parent
7b5a8c9
commit a53fc34
Showing
11 changed files
with
127 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Component customization | ||
|
||
### UNSAFE\_ props (advanced usage) | ||
|
||
General information for using `UNSAFE_` props can be found | ||
[here](/guides/customizing-components). | ||
|
||
**Note**: Use of `UNSAFE_` props is **at your own risk** and should be | ||
considered a **last resort**. Future Text updates may lead to unintended | ||
breakages. | ||
|
||
#### UNSAFE_style (mobile) | ||
|
||
The mobile Text component can be custom styled using the `textStyle` type via | ||
the `UNSAFE_style` prop. | ||
|
||
React Native does not support className. Instead, you can use `UNSAFE_style` to | ||
apply styles either inline or through a StyleSheet. | ||
|
||
##### Inline styles | ||
|
||
```tsx | ||
UNSAFE_style={{ textStyle: { color: tokens["color-purple--light"] } }} | ||
``` | ||
|
||
##### StyleSheet | ||
|
||
```tsx | ||
// Text.tsx | ||
UNSAFE_style={{ | ||
textStyle: styles.customTextStyle, | ||
}} | ||
|
||
// Text.style.ts | ||
export const styles = StyleSheet.create({ | ||
customTextStyle: { | ||
color: tokens["color-purple--light"], | ||
}, | ||
}); | ||
``` | ||
|
||
## Platform Considerations (Mobile) | ||
|
||
### Notes | ||
|
||
Text uses the core component [Text](https://reactnative.dev/docs/text) from | ||
`react-native`. | ||
|
||
### Copying text | ||
|
||
There are a few caveats around copying text on Android and iOS that you can read | ||
under the | ||
[Typography](../?path=/docs/components-text-and-typography-typography--docs#platform-considerations) | ||
documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters