Known issues and solutions
String.replaceAll() does not work on mobile
The below function can fix cases when String.replaceAll()
does not work in the mobile version. Most likely, this is some kind of WebView bug.
function replaceAll(str: string, search: string, replace: string) {
return str.split(search).join(replace);
}
Here’s the content translated and formatted for a technical audience:
Size of the Frame Not Changing and Content Appearing Hidden
The viewport size can be controlled using the Client.getInstance().setViewport({ height, width });
function.
This allows you to dynamically adjust the size of the frame within the x-bees interface.
To simplify the process of managing viewport changes, you can use the useViewPortEffect()
hook from the xbees-connect-react package.
Placing this hook at the root of your React component tree ensures that your application automatically reacts to changes in the app's size.
Here’s an example:
import { useViewPortEffect } from '@wildix/xbees-connect-react';
function App() {
useViewPortEffect();
return <AppWidgets />;
}
This approach makes it easier to handle viewport resizing and prevents hidden content by adjusting the application's layout dynamically based on the frame size.