Home Portfolio Blog template forked from Emerald

IT Blog - my diary of solving strange cases

  • 🚀React 🚀 - react-testing-library - mock image file with resolution for upload

    07 Jun 2021

    Github markdown version - can be easier to read Let’s say you have method to validate uploaded image file resolution and you call it to check if it pass and if doesn’t pass you prevent file submit to API - for example: https://stackoverflow.com/a/47786555/6423846 (but prettier ;) ) And then in...

  • 🚀React Native🚀 - react-navigation - force drawer item route navigation

    13 Mar 2021

    Github markdown version - can be easier to read The main point is to overwrite navigation property passed to DrawerItemList const onPress = { dispatch: (event: any) => { const routeName = event?.payload?.name; if (routeName) { return props.navigation.reset({ index: 0, routes: [{ name: routeName }] }); } return props.navigation.closeDrawer(); }...

  • 🚀Angular🚀 - @ngneat/transloco - multiple scopes merged and lazy loaded

    08 Jul 2020

    Github markdown version - can be easier to read Requirements: project with default @ngneat/transloco configuration If you use @ngneat/transloco and were wondering how to lazy load multiple scopes inside module there is a solution for you. So you have your project configured already with @ngneat/transloco and you want to simply...