This should create the second route, which should be accessible via the following URL:
Step 3: Create a Button to Navigate
But we still need a way to navigate to this route in our UI. Let's modify our PendingTasksScreen component to add a button:
Notice, that we use the push method from BlueBase's useNavigation hook. The method takes route name and optional params object as its arguments.
Run your app, you should now be able to navigate between routes.
Step 4: Extract Route Param
Notice that the value of path property in the route is :taskId. This means that any value that is entered in this part of the URL will be captured in the taskId param. For example the URL http://localhost:19006/p/tasks/123 will extract value 123 in the taskId variable.
Let's see how we can use this value, modify the EditTaskScreen component to match the following content:
Notice the code on Line 7, we use the getParam function to extract the URL param.