Using react-native-router-flux to create nested routers within components

I'm currently in the process of creating separate modules with their own routers, but I've been facing challenges in getting it to function properly.

At this point, I have the following configuration in index.ios.js

<Router hideNavBar={true}>
    <Schema name="default" sceneConfig={Navigator.SceneConfigs.FloatFromRight} />
    <Route name="start" component={Start}></Route>
    <Route name="main" component={Main}></Route>
</Router>

Additionally, I have a router defined within the Start component

class Start extends Component {
    render() {
        return (
            <Router name="startRouter">
                <Route name="login" component={Login} initial={true} rightTitle="Register" onRight={() => {
                    Actions.register();
                }} />
                <Route name="register" component={Register} title="Register" leftTitle="Login" />
           </Router>
        );
    }
};

Although the navigation bar appears correctly, clicking the Register button results in an error.

Any suggestions on how to resolve this issue would be greatly appreciated.

Thank you.

https://i.sstatic.net/WT9nU.png

Answer №1

Unfortunately, I am not aware of the specific syntax used when you initially posed your question. However, in the current version (3.35.0), it is worth noting that the key attribute should be utilized for defining scenes rather than name.

To illustrate, the proper syntax would appear as follows:

class Start extends Component {
    render() {
        return (
            <Router>
              <Scene key="startRouter">
                <Scene key="login" component={Login} initial={true} rightTitle="Register" onRight={ () => Actions.register() } />
                <Scene key="register" component={Register} title="Register" leftTitle="Login" />
              </Scene>
            </Router>
        );
    }
};

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is the Webpack vendors JS bundle in Vue CLI containing unlisted code that is not in the dependencies or package-lock.json file?

An information security auditing tool flagged an outdated library with known vulnerabilities in our webpack-bundled chunk-vendors.js file generated using Vue CLI: The library in question is YUI 2.9.0. It appears that this library is not fully included, a ...

ASP.NET can have issues with the functionality of jQuery AJAX

I'm currently working on an asp.net webform project and I'm looking to implement jQuery ajax functionality. Below is the code snippet I have so far: <asp:Button ID="btn_comment" runat="server" CssClass="contact_btn pull-right" Text="send" OnC ...

The offset of the content in UIWebView

I am struggling to display a Google Maps URL in a UIWebView within my app, but the page is loading at a different point than desired. I have tried various solutions such as adjusting the contentOffset of the webview's scrollview, contentInset, scrolls ...

The error message "Adyencheckout is not a constructor" is popping up in my

Struggling to implement the Adyen dropin payment UI in NextJS and facing issues initializing the Adyen dropin component. Attempting to dynamically import Adyen web to avoid window is not defined error, but uncertain on how to use it as a constructor after ...

The total number of items in the cart is experiencing an issue with updating

For a recording of the issue, click here: While everything works fine locally, once deployed to production (vercel), it stops working. I've tried numerous approaches such as creating a separate state in the cart, using useEffect with totalQuantity in ...

Trigger a page refresh when you revisit it

Currently, I am utilizing Nuxt in SPA mode and my page structure is set up like this: pages ... - users/ - - index - - new - - update/ - - - _id ... I have a page dedicated to displaying a list of users along with a 'subpage' for adding new u ...

The getJSON API functions properly on a local machine but encounters issues when deployed on a

I have a vision to create a web application that can display the weather of any city based on user input. I've divided my project into three files - index.html for collecting user input, index2.html for retrieving and displaying the data, and a CSS fi ...

Is there a way to combine JavaScript, CSS, and HTML code in a single HTML document?

Is there a way to include both <script> and <style> elements within the same HTML body? <html> <head> <title>My site title</title> </head> <body> </body> </html> I am looking to in ...

Unable to locate npm module called stream

For some reason, our tests have stopped running since yesterday. The error message reads: module stream not found Upon investigation, we discovered that 'stream' is available as a core node module: https://nodejs.org/api/stream.html#apicontent ...

Tips for setting cookie options in cookie-session version 1.0.2

Currently, I am delving into the intricacies of the "cookie-session" module in Node.js. https://github.com/expressjs/cookie-session My struggle lies in comprehending how to pass options for the cookie, particularly regarding expiration time. The default ...

Tracking the number of images and adjusting the counter as the user scrolls

I am working on a project where I have a series of images displayed in a column. I would like to add a dynamic counter to indicate which image is currently in focus based on the scroll position. Feel free to check out the demo <div class="counter"> ...

The radar chart created with amchart.js disappears when placed within bootstrap columns

I'm encountering an issue while trying to display radar charts using amchart.js in bootstrap columns. The "amStockGraph" charts render perfectly, however, the radar charts appear blank with no errors in the console. Any advice on this matter would be ...

Mastering Light and Camera Selection in Three.js

Question, In the editor found at this link, you can click on a light or camera to select it. I am familiar with using raycaster.intersectObjects(objects) to select meshes, but how can I achieve the same result for lights and cameras which do not have mesh ...

The Add and Update functions of an AngularJS application are malfunctioning in Internet Explorer

Encountered a situation where updates and additions in IE show results in Chrome :D // Extract category object and id from the parent $scope.addNewCategory = function (category, parentId) { $scope.resetError(); category.parentId = par ...

Printing a Page Using Angular 5

Is there a way to print a specific section of my website with Angular 5? I've searched online for a solution, but it seems like most options are tailored for Angular. Any advice? ...

"Discovering the magic behind leaflet js's method of fetching tiles directly from

If you imagine tiles being stored in a file system similar to the image shown below https://i.sstatic.net/6NryK.png You can take a quick look at this URL Take a look at the code var map = L.map('map').setView([0, 0], 2); L.tileLayer(& ...

String refs are not allowed for function components. It is advised to use useRef() instead, especially when working with Nextjs

I recently encountered an error when trying to add data to the server using Next.js with the fetch method and thunk. The error message I received was: Error: Function components cannot have string refs. We recommend using useRef() instead. addBookForm.j ...

How can I modify the font color in a personalized button paired with an icon?

New to Qt/QML and exploring how to design a custom button with a label and icon. I'm looking to make the font bold and use a bright color since the button will be on a dark background. However, I'm encountering an issue where defining label: Text ...

Issue encountered while executing tasks in the Gruntfile.js file

Having trouble with Grunt concatenating my CSS files into one named production.css Below is the output I received from the command prompt: C:\Users\josha\Desktop\Repos\AJAX Project - Grunt Test>grunt C:\Users\josha& ...

React-based video annotation/overlay features in the style of Youtube tutorials

Our team is in need of a video annotation system similar to YouTube's. We require the ability to add text/images over videos at specific times. I tried looking for React components or vanilla JS libraries for guidance, but couldn't find any. If ...