File size: 441 Bytes
f5071ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import React from 'react';
import { useSelector } from 'react-redux';
import { Navigate } from 'react-router-dom';
import CreatePost from './CreatePost';
const EditPost = () => {
const currentPostData = useSelector(
(state) => state.currentPost.currentPostData
);
if (!currentPostData) {
return <Navigate to={-1} />;
}
return <CreatePost currentPostDataToEdit={currentPostData} />;
};
export default EditPost;
|