react-native
react-native-render-html: “You seem to update the X prop of the Y component in short periods of time…”
Usually, this warning shows up when: The parent (currently App) component updates very often and causes WebDisplay component to re-render. In the provided snippet, every 30 milliseconds; At least one prop passed to RenderHTML is referentially unstable between each re-render. In the provided snippet, tagsStyles reference changes on every re-render. Notice that between every update … Read more
how to display the entire object in console in react native
You can stringify it. console.log(JSON.stringify(organizations)); if you want some formatting console.log(JSON.stringify(organizations, null, 2));
React – useMemo without dependencies array vs empty array
Using useMemo() without dependencies array will calculate the value on every render. If no array is provided, a new value will be computed on every render. It’ll be equivalent to const value = … Using useMemo() with an empty dependencies array will calculate the value only once, on mount. Demo: const App = () => … Read more
com.android.builder.testing.api.DeviceException: No connected devices
If you have android studio installed(if not install it) launch android studio with a dummy project, go to Tools -> AVD Manager. Make sure that you create a virtual device and start it. Note: To create this virtual device you will need to download and install a compatible OS (compatible with your project’s Android SDK … Read more
Re-render component when navigating the stack with React Navigation
If you are using React Navigation 5.X, just do the following: import { useIsFocused } from ‘@react-navigation/native’ export default function App(){ const isFocused = useIsFocused() useEffect(() => { if(isFocused){ //Update the state you want to be updated } }, [isFocused]) } The useIsFocused hook checks whether a screen is currently focused or not. It returns … Read more