How do I store navigation in aurelia store? - aurelia

How can I store navigation and clicks (the router state changes) with aurelia store? Why doesn't it do this out of the box?

Related

How to persist state in a WebviewProvider?

I have an extension that renders in the sidebar.
The extension is WebviewProvider that resolves a Webview.
I need to persist state in a Webview but the docs only describes how to do this in a WebviewPanel.
https://code.visualstudio.com/api/extension-guides/webview#getstate-and-setstate
How do you persist state in a Webview?

Pass data from profile screen to custom navigation drawer

I am displaying profile pic and username in my app drawer. But drawer updating when I restart the app again. I am new to react native so I don't know how to refresh my drawer after changing profile pic in my profile screen. I searched about it and found it can be done by redux, but I am not getting any proper code to do that.
Have a try by saving the userData in the Redux and get the userData from the redux in the Drawer Component so whenever data changes it will be reflected the Component where it is being used.
check out the official docs for redux.
https://react-redux.js.org

Updating state values from different screen

Very new to ReactNative.
Please let me know if I'm doing something unproperly.
On Screen A, I have a interval that handle a REST request and updates my Screen A state and its components.
Working fine so far!
To navigate to Screen B
this.props.navigation.navigate('ScreenB', {state: this.state});
and I'm using that state values to mount ScreenB components.
Even with ScreenB showing, at some point ScreenA interval updates my ScreenA state with new data.
What is the proper way to pass these new data to ScreenB state and update its components?
I thought passing state on navigation props would keep the same object (state) on all screens, but this is apparently wrong.
The best way is to add a common state management library like redux and use it across your screens. Once you have updated the data in one screen, you can dispatch an action to update the store. The page2 which is now showing will consume the change and rerender the new data changes.

React-Native - Global component instead of using redux?

I'm looking for a way to have a global component, so that my webview in it wont reset every time i switch over with Router to that parent's component.
Any ways to make save webviews data with redux so it won't reset each time, or a global component?

Sticky Views while react-navigation

Im trying to build a mobile app where we have a constant header bar throughout the app. I have the body where I have buttons.. Each button navigates to a screen. I need the header bar in every screen but I dont wish to repeat the code in all screens. I dont intend to use TabNavigator either. Is there any alternative??
in image1 and image 2 the bar with the search,cart and offerzone tag remains same. The rest changes..I need this behaviour without repeating the header code in both screens.
You can separate the code of headerBar into a independent component, and use redux store to manage this component's props.
After you do this, you just need to import the component in each screen, the component will get its props from redux store automatically. Each screen can contact headerBar with redux actions