Skip to content

Commit a32a092

Browse files
committed
Add props interview questions
1 parent 889fe63 commit a32a092

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
|253| [Is it React support all HTML attributes?](#is-it-react-support-all-html-attributes)|
270270
|254| [What are the limitations with HOCs?](#what-are-the-limitations-with-hocs)|
271271
|255| [How to debug forwardRefs in DevTools?](#how-to-debug-forwardrefs-in-devtools)|
272+
|256| [When component props defaults to true?](#when-component-props-defaults-to-true)|
272273

273274
## Core React
274275

@@ -4296,4 +4297,12 @@
42964297

42974298
return React.forwardRef(forwardRef);
42984299
}
4299-
```
4300+
```
4301+
256. ### When component props defaults to true?
4302+
If you pass no value for a prop, it defaults to true. This behavior is available so that it matches the behavior of HTML. For example, below expressions are equivalent,
4303+
```javascript
4304+
<MyInput autocomplete />
4305+
4306+
<MyInput autocomplete={true} />
4307+
```
4308+
**Note:** It is not recommend using this approach because it can be confused with the ES6 object shorthand (example, {name} which is short for {name: name})

0 commit comments

Comments
 (0)