Navigation
Give the user a tour of your beautiful app using the navigation functions.
Navigateβ
Open a different block from the app. The block will be shown in a dialog-like fashion with a close button instead of a back button.
import { navigate } from '@myjsblock/sdk'
await navigate('List6');
// List6 was closed
Passing propertiesβ
Data can be passed to the page by using the properties
argument. Data will be exposed in to the block via the data fields and {data:<name>}
template syntax. For example, for payment and checkout pages or other detail pages.
import { navigate } from '@myjsblock/sdk'
await navigate('List6', {
paymentId: '123456'
});
// List6 was closed
Argumentsβ
variableName
String
β
-
properties
{ [key]: anyValue }
-
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
INVALID_ARGUMENT
There is no block with variable name variableName
.
Go Backβ
Great for custom back buttons. By calling this function the user will be navigated back to the previous block, like pressing back on the device.
import { goBack } from '@myjsblock/sdk'
await goBack();
Exampleβ
import { goBack } from '@myjsblock/sdk'
async function onPaymentComplete() {
await goBack(
true
);
}
Arguments
reload
Boolean
false
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
Last updated
Was this helpful?