Skip to content

Commit 1520219

Browse files
author
Mohit
committed
updated readme
1 parent a3d7627 commit 1520219

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm i react-native-sugar-style
1818

1919
### Usage
2020

21-
STEP 1: _style.tsx_
21+
STEP 1: **style.tsx**
2222

2323
Define configurations for your theme see [this file](https://github.com/mohit23x/react-native-sugar-style/blob/main/example/style/index.tsx) for a more verbose example
2424

@@ -37,6 +37,8 @@ export const { StyleSheet, ThemeProvider, useTheme } = Sugar.init<Theme>(theme);
3737
export default StyleSheet;
3838
```
3939

40+
<br />
41+
4042
STEP 2: **App.tsx** (optional)
4143

4244
Wrap with ThemeProvider, if you are using a single theme then this step is not needed skip to STEP 3
@@ -53,6 +55,8 @@ const App = () => (
5355
);
5456
```
5557

58+
<br />
59+
5660
STEP 3: **component.tsx**
5761

5862
Use StyleSheet as you do normally in react native component
@@ -87,6 +91,8 @@ const styles = StyleSheet.create((theme) => ({
8791

8892
> **NOTE**: if you have a single theme then `useTheme()` hook can be avoided, also if you add `useTheme()` in you navigation screen parent component, then you can avoid using it in child components\*
8993
94+
<br />
95+
9096
STEP 4: **anotherComponent.tsx** (optional)
9197

9298
To change the theme you can call build method and it will swap the theme

0 commit comments

Comments
 (0)