@@ -8,7 +8,7 @@ import FirstEditorSrc from '!!raw-loader!@site/src/examples/FirstEditor';
88
99# Your first editor
1010
11- Let's build a small editor with a button that toggles bold and lights up when
11+ Let's build a small editor with a button that toggles bold and highlights when
1212the current selection is bold. It's just enough to see the two moving parts of
1313the library: ** calling methods on the input** and ** reading its state back** .
1414
@@ -34,7 +34,9 @@ export default function App() {
3434}
3535
3636const styles = StyleSheet .create ({
37- container: { gap: 12 },
37+ container: {
38+ gap: 12
39+ },
3840 input: {
3941 fontSize: 18 ,
4042 color: ' #232736' ,
@@ -48,9 +50,6 @@ const styles = StyleSheet.create({
4850
4951## Toggling a style
5052
51- The input is uncontrolled - you don't change its content through props. Instead
52- you call methods on it through a ` ref ` of type ` EnrichedTextInputInstance ` .
53-
5453Add a ref and a button that calls ` toggleBold ` . Each call flips bold on the
5554current selection, or arms it for the next characters you type if nothing is
5655selected.
@@ -79,7 +78,9 @@ export default function App() {
7978}
8079
8180const styles = StyleSheet .create ({
82- container: { gap: 12 },
81+ container: {
82+ gap: 12
83+ },
8384 input: {
8485 fontSize: 18 ,
8586 color: ' #232736' ,
@@ -103,8 +104,11 @@ const styles = StyleSheet.create({
103104});
104105```
105106
106- Every other style is toggled similarly via ` ref ` - there's a ` toggleItalic ` ,
107- ` toggleUnderline ` , ` toggleH1 ` , ` toggleOrderedList ` , and so on.
107+ :::note
108+
109+ To learn how you can toggle each of the available styles, visit [ Basic styles] ( /rich-text-formatting/basic-styles ) .
110+
111+ :::
108112
109113## Reading the state back
110114
@@ -147,7 +151,9 @@ export default function App() {
147151}
148152
149153const styles = StyleSheet .create ({
150- container: { gap: 12 },
154+ container: {
155+ gap: 12
156+ },
151157 input: {
152158 fontSize: 18 ,
153159 color: ' #232736' ,
0 commit comments