Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit 2ad82e0

Browse files
committed
refactor the code
1 parent 29df531 commit 2ad82e0

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/components/Posts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Posts extends Component {
88
this.props.fetchPosts();
99
}
1010

11-
componentWillReceiveProps(nextProps) {
11+
UNSAFE_componentWillReceiveProps(nextProps) {
1212
if (nextProps.newPost) {
1313
this.props.posts.unshift(nextProps.newPost);
1414
}

src/reducers/postReducer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { FETCH_POSTS, NEW_POST } from "../actions/types";
2-
import { act } from "react-dom/test-utils";
32

43
const initialState = {
54
items: [],

0 commit comments

Comments
 (0)