react-navigation headerbackbutton not export member of navigation
To use the HeaderBackButton
component from react-navigation
in an Ember project, you need to make sure that you have installed and imported the necessary dependencies correctly. Here are the steps you can follow:
- Install the required packages by running the following command in your Ember project directory:
npm install react-navigation react-navigation-stack
- Import the necessary components into your Ember component file. In the file where you want to use the
HeaderBackButton
, add the following import statement:
javascript
import HeaderBackButton from 'react-navigation-stack/lib/module/views/Header/HeaderBackButton';
- Once you have imported the
HeaderBackButton
, you can use it in your component's template. Here's an example of how you can use it:
handlebars
{{#react-navigation-stack as |Stack|}}
{{#Stack.Navigator}}
{{#Stack.Screen
name="ScreenName"
component=YourComponent
options=(hash
headerLeft=(component HeaderBackButton)
)}}
{{/Stack.Screen}}
{{/Stack.Navigator}}
{{/react-navigation-stack}}
In this example, the HeaderBackButton
component is set as the headerLeft
option for the Screen
component. You can adjust the options based on your specific requirements.
By following these steps, you should be able to use the HeaderBackButton
component from react-navigation
in your Ember project.