mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
Update typechecking-with-proptypes.md
add 'javascript' after ```
This commit is contained in:
@@ -147,7 +147,7 @@ MyComponent.propTypes = {
|
||||
|
||||
You can define default values for your `props` by assigning to the special `defaultProps` property:
|
||||
|
||||
```
|
||||
```javascript
|
||||
const defaultProps = {
|
||||
name: 'Stranger'
|
||||
};
|
||||
@@ -172,7 +172,7 @@ ReactDOM.render(
|
||||
|
||||
You can also put propTypes and defaultProps as static props inside React class.
|
||||
|
||||
```
|
||||
```javascript
|
||||
class Greeting extends Component {
|
||||
|
||||
static defaultProps = {
|
||||
|
||||
Reference in New Issue
Block a user