Skip to content

Commit ad252cd

Browse files
authored
Merge pull request #345 from naazeri/master
fix typo in README.md
2 parents 4e12c89 + dc34667 commit ad252cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ class ParentComponent extends React.Component {
10111011

10121012
The controlled components will be implemented using the below steps,
10131013

1014-
1. Initialize the state using use state hooks in function components or inside constructor for class components.
1014+
1. Initialize the state using `useState` hooks in function components or inside constructor for class components.
10151015
2. Set the value of the form element to the respective state variable.
10161016
3. Create an event handler to handle the user input changes through useState updater function or setState from class component.
10171017
4. Attach the above event handler to form elements change or click events
@@ -1043,12 +1043,12 @@ class ParentComponent extends React.Component {
10431043
10441044
22. ### What are uncontrolled components?
10451045
1046-
The **Uncontrolled Components** are the ones that store their own state internally, and you query the DOM using a ref to find its current value when you need it. This is a bit more like traditional HTML.
1046+
The **Uncontrolled Components** are the ones that store their own state internally, and you query the DOM using a `ref` to find its current value when you need it. This is a bit more like traditional HTML.
10471047
10481048
The uncontrolled components will be implemented using the below steps,
10491049
1050-
1. Create a ref using useRef react hook in function component or `React.createRef()` in class based component.
1051-
2. Attach this ref to the form element.
1050+
1. Create a ref using `useRef` react hook in function component or `React.createRef()` in class based component.
1051+
2. Attach this `ref` to the form element.
10521052
3. The form element value can be accessed directly through `ref` in event handlers or `componentDidMount` for class components
10531053
10541054
In the below UserProfile component, the `username` input is accessed using ref.

0 commit comments

Comments
 (0)