Comments (4)
I think that's just how it is made. I have the same thing. I dont think there is a solution
from instagramclone.
Hi!
Right now the auto reload is not implemented in the project, however it is not hard to do. Just rerun the fetch function and it should update both for the comments and profile.
from instagramclone.
Hi!
Right now the auto reload is not implemented in the project, however it is not hard to do. Just rerun the fetch function and it should update both for the comments and profile.
Thank you Simcoder for answering! But the fetch is happening in the useEffect(), isn't it supposed to re-fetch automatically when the component is updated?
from instagramclone.
My second issue is that when I upload a picture It doesn't appear automatically on the profile, I should refresh the app or log out and re-login to see it. Can anyone help me with these issues, please? Thanks in advance!
I managed to fix this by connecting redux in the save.js then binding the fetchUserPosts() to the mapDispatchProps and calling the fetchUserPosts()
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { fetchUserPosts } from '../../redux/actions';
function Save(props){
...
}
const mapDispatchProps = (dispatch) => bindActionCreators({ fetchUserPosts }, dispatch);
export default connect(null, mapDispatchProps)(Save);
Then before you props.navigation.popToTop() you add props.fetchUserPosts()
to ensure the state is updated. After we post you must also add the props.posts to your useEffect in the profile page. to
ensure it updates when the posts state changes
useEffect(() => { .... }, [props.posts] )
This fixed that issue for me, I hope it can help others when they are coming across this issue.
from instagramclone.
Related Issues (20)
- Unable to start your application. Please refer to https://expo.fyi/no-registered-application for more information. at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:200:6 in runApplication
- I can't seem to load comments with username attached
- snapshot.ZE.path.segments is undefined HOT 1
- updateUserFeedPosts is not defined in Redux actions HOT 1
- ReferenceError: Can't find variable: initialState
- Setup-your-project - need exact versions to install to avoid errors HOT 3
- 903433436
- When following the wiki to deploy section e In the indexes tab create the following index: is left blank.
- Has anyone succeeded adding drawer navigation to profile screen?
- Section (e) of wiki "In the indexes tab create the following index: " is left blank.
- Bl
- npm install expo - can't start project? HOT 2
- https://github.com/SimCoderYoutube/InstagramClone.wiki.git
- The error you're experiencing is a dependency resolution problem in npm
- Instagram hack HOT 1
- Clone instagram
- const found = getState().usersState.users.some(el => el.uid === uid) HOT 1
- Inka
- Issue when fetching Feed from following
- Issue getting uid using getState from redux
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagramclone.