<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tran Ngoc Tung on Medium]]></title>
        <description><![CDATA[Stories by Tran Ngoc Tung on Medium]]></description>
        <link>https://medium.com/@tungtran91?source=rss-27ae06b72a10------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IPVFjv2yMasQU0-k.</url>
            <title>Stories by Tran Ngoc Tung on Medium</title>
            <link>https://medium.com/@tungtran91?source=rss-27ae06b72a10------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 02:52:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tungtran91/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Testing with Appium got Error]]></title>
            <link>https://medium.com/@tungtran91/testing-with-appium-got-error-cb36734bda0f?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb36734bda0f</guid>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Wed, 26 Aug 2020 03:52:47 GMT</pubDate>
            <atom:updated>2020-08-26T03:52:47.911Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing with Appium got Error: Request failed due to Error: The URL ‘/session’ did not map to a valid resource</p><p>I’m building the testing for React Native App with Appium, im use Visual Code .</p><p>I got this issue</p><h3>webdriver: Request failed due to Error: The URL ‘/session’ did not map to a valid resource</h3><p>So my <strong>wdio.conf.js</strong></p><blockquote>exports.config = {<br> services: [‘appium’],<br> runner: ‘local’,<br> //<br> // Override default path (‘/wd/hub’) for chromedriver service.<br> path: ‘/’,<br> port: 4723,<br><br> specs: [<br> ‘./test_cases/**/*.js’<br> ],<br> <br> <br> capabilities: [{<br> maxInstances: 1,<br> appiumVersion: ‘1.13.0’,<br> platformName: ‘Android’,<br> platformVersion: ‘10’,<br> deviceName: ‘Pixel_3a_API_29’,<br> app: ‘/Volumes/CodeSpace/ReactNative/wesport-user-rn/android/app/build/outputs/apk/debug/app-debug.apk’,<br> automationName: ‘UiAutomator2’<br> }],<br> logLevel: ‘trace’,<br> bail: 0,<br> waitforTimeout: 50000,<br> connectionRetryTimeout: 90000,<br> connectionRetryCount: 3,<br> framework: ‘mocha’,<br> reporters: [‘spec’],<br> mochaOpts: {<br> ui: ‘bdd’,<br> timeout: 60000<br> }<br>}</blockquote><h3>How to fix ?</h3><p>Just remove this line</p><blockquote>path: ‘/’,</blockquote><p>we use default path for Appium , it’s will work .</p><p>Relation Error</p><blockquote>[HTTP] No route found. Setting content type to ‘text/plain’</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb36734bda0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Electron JS] [Responsive] Get Screen Height and Width.]]></title>
            <link>https://medium.com/@tungtran91/electron-js-responsive-get-screen-height-and-width-e99e9333c055?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/e99e9333c055</guid>
            <category><![CDATA[electronjs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[desktop-app]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Wed, 02 Oct 2019 15:01:17 GMT</pubDate>
            <atom:updated>2019-10-02T15:01:17.490Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to write an application that runs responsive on desktop screens. You will need to know the height and width of the current screen.</p><p>A small example: I want my application to start always full screen, or as a percentage.</p><p>First you need import <strong>screen</strong> from electron ;</p><blockquote>import { screen } from “electron”;</blockquote><p>After that , you need get width height of current screen</p><blockquote>const { width, height } = screen.getPrimaryDisplay().workAreaSize;</blockquote><p>And you will need set height and width in app when it <strong>ready</strong> , and you’ll start with a <strong>MainWidow</strong> define by new <strong>BrowserWindow </strong>with two parameter height and width.</p><blockquote>mainWindow = new BrowserWindow({</blockquote><blockquote>height: height ,</blockquote><blockquote>webPreferences: {</blockquote><blockquote>preload: path.join(__dirname, “preload.js”),</blockquote><blockquote>},</blockquote><blockquote>width: width,</blockquote><blockquote>});</blockquote><p>If you wanna set with percent just set hight and width with percentage.</p><p>For example i want my app will launch with 90% percent height and 90% width just coding :</p><blockquote>mainWindow = new BrowserWindow({</blockquote><blockquote>height: height * 0.9 ,</blockquote><blockquote>webPreferences: {</blockquote><blockquote>preload: path.join(__dirname, “preload.js”),</blockquote><blockquote>},</blockquote><blockquote>width: width * 0.9,</blockquote><blockquote>});</blockquote><p>But wait… something wrong with my code , it’s not launch with 90% and height 90% ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AjYmgS7VB5kDHHbGHpyvnQ.png" /></figure><p>Because my expression is returned to <strong>decimal…</strong>Opps …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkbyzyqRtVfMAvoK_u0mDA.png" /></figure><p><strong>It’s OK now….</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e99e9333c055" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Permissions denied when install Nativescript]]></title>
            <link>https://medium.com/@tungtran91/permissions-denied-when-install-nativescript-3d2c25231e36?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d2c25231e36</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[nativescript]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Wed, 28 Aug 2019 07:43:36 GMT</pubDate>
            <atom:updated>2019-08-28T07:43:36.919Z</atom:updated>
            <content:encoded><![CDATA[<p>Error appear when i install NativeScript with command :</p><blockquote>sudo npm install -g nativescript@6.0.3</blockquote><blockquote>&gt; nativescript@5.0.2 preuninstall /Users/xxxx/.nvm/versions/node/v10.3.0/lib/node_modules/nativescript</blockquote><blockquote>&gt; node preuninstall.js</blockquote><blockquote>/Users/xxxx/.nvm/versions/node/v10.3.0/bin/tns -&gt; /Users/xxxx/.nvm/versions/node/v10.3.0/lib/node_modules/nativescript/bin/tns</blockquote><blockquote>/Users/xxxx/.nvm/versions/node/v10.3.0/bin/nativescript -&gt; /Users/xxxx/.nvm/versions/node/v10.3.0/lib/node_modules/nativescript/bin/tns</blockquote><blockquote>&gt; nativescript@5.0.2 postinstall /Users/xxxx/.nvm/versions/node/v10.3.0/lib/node_modules/nativescript</blockquote><blockquote>&gt; node postinstall.js</blockquote><blockquote>EACCES: permission denied, mkdir ‘/Users/xxxx/.nvm/versions/node/v10.3.0/lib/node_modules/nativescript/docs/html’</blockquote><blockquote>ice.js:4:58)\n at process._tickCallback (internal/process/next_tick.js:68:7)’,</blockquote><blockquote>errorCode: 127,</blockquote><blockquote>suppressCommandHelp: true,</blockquote><blockquote>proxyAuthenticationRequired: false,</blockquote><blockquote>printOnStdout: undefined }</blockquote><h3>How to resolve ?</h3><p>JUST adding — unsafe-perm.</p><blockquote>sudo npm install nativescript@x.x.x -g<strong> — unsafe-perm</strong></blockquote><p>Fails because it eventually executes a npm install over the new application, which is OK as it inherits the sudo from the create command, but the postinstall scripts fail to execute with root privileges as the CLI does’t use — unsafe-perm for the npm install.</p><p>To fix the already created application you can run sudo npm install — unsafe-perm in the root of the project. This will execute the postinstall scripts with the right permissions.</p><p>To fix project creation in general you can try sudo chown -R matt /home/matt/.npm. This should allow you to run tns without adding sudo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d2c25231e36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React/typescript: Parameter ‘props’ implicitly has an ‘any’ type error]]></title>
            <link>https://medium.com/@tungtran91/react-typescript-parameter-props-implicitly-has-an-any-type-error-653f224f6b9d?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/653f224f6b9d</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 17:06:43 GMT</pubDate>
            <atom:updated>2019-08-11T17:07:37.307Z</atom:updated>
            <content:encoded><![CDATA[<p>In type script you need to specify the type of props you are going to send or it takes the default type defined tin <a href="http://twitter.com/types/react">@types/react</a>. if you dont want to specify any type then explicitly ask the component to expect state and props of ‘any’ type.</p><h3><strong>How to fix ?</strong></h3><p>Specifying the type of the constructor parameter resolved this issue in my case.</p><blockquote>interface Props {}</blockquote><blockquote>interface State {}</blockquote><blockquote>export default class App extends React.Component&lt;Props, State&gt; {</blockquote><blockquote>constructor(props : Props) {super(props);}}</blockquote><p>Or different way :</p><pre>class MyComponent extends React.Component&lt;any, any&gt; {<br><br>    constructor(props: any) {<br>        super(props);<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=653f224f6b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[React JS] [Next.js] npm run dev get Error]]></title>
            <link>https://medium.com/@tungtran91/react-js-next-js-npm-run-dev-get-error-be36f56c4104?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/be36f56c4104</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 08:11:24 GMT</pubDate>
            <atom:updated>2019-08-11T08:11:24.476Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Couldn’t find a `pages` directory. Please create one under the project root</strong></p><p>The nextJS need to “pages” directory.</p><p>Make the “pages” and then inside make the index.js.</p><p>For example:</p><p>your_root_project/pages/index.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOOvz0Q41F2y3LxWgwvurg.png" /></figure><h3>HOW TO STRUCTURE PROJECT REACT JS USERS NEXT.JS ?</h3><p>The internal directory structure of the project uses Next.js :</p><p>For more , next.js with your customize router :</p><ul><li>pages/index.js with router is /</li><li>pages/about.js with router is /about</li><li>pages/account.js with router is /account</li></ul><p>Or</p><p>Just like that, simply create a file so you can create a route, with a sub-level, create a directory, for example:</p><ul><li>pages/account/manager.js with router <strong>/account/manager</strong></li><li>pages/account/admin.js with router <strong>/account/admin.</strong></li></ul><p>Hope it help ~.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be36f56c4104" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two-Factor Authentication (2FA) with GitHub in SourceTree]]></title>
            <link>https://medium.com/@tungtran91/two-factor-authentication-2fa-with-github-in-sourcetree-ea320b26e596?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea320b26e596</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[sourcetree]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Fri, 09 Aug 2019 17:33:59 GMT</pubDate>
            <atom:updated>2019-08-09T17:33:59.478Z</atom:updated>
            <content:encoded><![CDATA[<h3>Purpose</h3><p>GitHub allows accounts to be configured to use two-factor authentication (2FA). SourceTree can work with GitHub’s Two-Factor Authentication model.</p><h3>Solution</h3><p>To work with GitHub’s two-factor authentication in SourceTree you can simply use your access token instead of your password. The steps to do this are as follows:</p><ol><li>Go to your <strong>Personal Access Tokens</strong> settings in GitHub.</li><li>Click on the <strong>Generate new token</strong> button.</li><li>Name the token something descriptive.</li><li>Select which scopes you wish to grant this token.</li><li>Click the <strong>Generate token</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L45wmtYnDYPv8fOvdgczIg.png" /><figcaption><strong>Generate and Save Your Token</strong></figcaption></figure><p>6. Copy the token and use it as a password in your hosted repositories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lTlbpJYn6mwfzT9fR9kzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m7sg1JJSk_Bm4fJaGMR-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msUdoWsSZ5LBiRZlzYejZQ.png" /><figcaption>Change your password with new token just generate.</figcaption></figure><p>Hope it help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea320b26e596" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[react-navigation]How to Navigate Between Nested Stacks?]]></title>
            <link>https://medium.com/@tungtran91/react-navigation-how-to-navigate-between-nested-stacks-5f45f4d1f660?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f45f4d1f660</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 07:20:52 GMT</pubDate>
            <atom:updated>2019-08-05T07:29:33.874Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s assume you have 5 screens in your mobile application, and you’re using <strong>react-navigation</strong> to navigate them. How can flow flow between these screens be clearer and easier to control in cases of navigation by physical buttons like onBackPress on Android os?</p><p>Or a new participant in your project, how can they have a more general picture of the main screens and the main flows of your mobile application?</p><p>Imagine that you have 5 screens below, giving 2 separate navigation, 1 for Auth flow, 2 for Home flow.And you used Drawer navigation - React Navigation .</p><blockquote>const routeAppConfiguration = {</blockquote><blockquote>[Routes.HOME]: {</blockquote><blockquote>screen: Home,</blockquote><blockquote>navigationOptions: ({ navigation }) =&gt; ({</blockquote><blockquote>header: null,</blockquote><blockquote>headerLeft: null,</blockquote><blockquote>gesturesEnabled: false,</blockquote><blockquote>}),</blockquote><blockquote>},</blockquote><blockquote>[Routes.NOTIFY_CENTER]: {</blockquote><blockquote>screen: NotifyCenter,</blockquote><blockquote>navigationOptions: ({ navigation }) =&gt; ({</blockquote><blockquote>header: null,</blockquote><blockquote>}),</blockquote><blockquote>},</blockquote><blockquote>};</blockquote><blockquote>//ListScreen for Auth</blockquote><blockquote>const routeAuthConfiguration = {</blockquote><blockquote>[Routes.LOGIN]: {</blockquote><blockquote>screen: Login,</blockquote><blockquote>},</blockquote><blockquote>[Routes.REGISTER]: {</blockquote><blockquote>screen: Register,</blockquote><blockquote>},</blockquote><blockquote>[Routes.FORGOT_PASSWORD]: {</blockquote><blockquote>screen: ForgotPassword,</blockquote><blockquote>},</blockquote><blockquote>};</blockquote><h3><strong>For next step , creat Stack Navigator for each flow navigation .</strong></h3><blockquote>const OnboardingStack = createStackNavigator(routeAppConfiguration, {</blockquote><blockquote>initialRouteName: Routes.HOME,</blockquote><blockquote>navigationOptions: {</blockquote><blockquote>header: null,</blockquote><blockquote>},</blockquote><blockquote>});</blockquote><blockquote>const AuthStack = createStackNavigator(routeAuthConfiguration, {</blockquote><blockquote>initialRouteName: Routes.LOGIN,</blockquote><blockquote>navigationOptions: {</blockquote><blockquote>header: null,</blockquote><blockquote>},</blockquote><blockquote>});</blockquote><blockquote>initialRouteName is a default screen will launch when you go to once stack navigatior</blockquote><h3>And next step, creat one stack for All stack flow :</h3><blockquote>const RootStack = createAppContainer(</blockquote><blockquote>createSwitchNavigator(</blockquote><blockquote>{</blockquote><blockquote>Auth: { screen: AuthStack },</blockquote><blockquote>Onboarding: { screen: OnboardingStack },</blockquote><blockquote>},</blockquote><blockquote>{</blockquote><blockquote>initialRouteName: ‘Auth’,</blockquote><blockquote>navigationOptions: {</blockquote><blockquote>header: null,</blockquote><blockquote>},</blockquote><blockquote>},</blockquote><blockquote>),</blockquote><blockquote>);</blockquote><h3>And the final (if you wanna use Drawer navigation):</h3><blockquote>const DrawerNavigation = createDrawerNavigator(</blockquote><blockquote>{</blockquote><blockquote>RootStack: RootStack,</blockquote><blockquote>},</blockquote><blockquote>{</blockquote><blockquote>drawerPosition: ‘right’,</blockquote><blockquote>contentComponent: SlideScreen,</blockquote><blockquote>drawerWidth: width_full * 0.75,</blockquote><blockquote>drawerOpenRoute: ‘DrawerOpen’,</blockquote><blockquote>drawerCloseRoute: ‘DrawerClose’,</blockquote><blockquote>//drawerToggleRoute: ‘DrawerToggle’,</blockquote><blockquote>},</blockquote><blockquote>);</blockquote><blockquote>export default createAppContainer(DrawerNavigation);</blockquote><blockquote>_navigationToHome() {</blockquote><blockquote>this.props.navigation.navigate(Routes.HOME);</blockquote><blockquote>}</blockquote><p>goBack Between StackNavigators</p><blockquote>this.props.navigation.goBack();</blockquote><p><strong>react-navigation</strong></p><p>StackNavigators : Navigate and delete previous route.</p><blockquote>navigateToLogin() {<br> const resetAction = NavigationActions.reset({<br> index: 1,<br> actions: [<br> NavigationActions.navigate({ routeName: ‘Router.HOME’ }),<br> NavigationActions.navigate({ routeName: ‘Router.LOGIN’ })<br> ]<br> });</blockquote><blockquote>this.props.navigation.dispatch(resetAction);<br>}</blockquote><h3>disable the drawerNavigator from swiping open on nested stackNavigators</h3><p>you can disable the drawer on any screen just have to add:</p><blockquote>navigationOptions: {<br> drawerLockMode: ‘locked-closed’<br>}</blockquote><p>React Navigation : Back button doesn’t go to previous scene but go to initialRouteName.</p><p>Happy coding .~</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f45f4d1f660" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[React Native][React] call function inside .then async function got an error]]></title>
            <link>https://medium.com/@tungtran91/react-native-react-call-function-inside-then-async-function-got-an-error-17a473ccf511?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/17a473ccf511</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 10:02:23 GMT</pubDate>
            <atom:updated>2019-07-29T10:04:07.422Z</atom:updated>
            <content:encoded><![CDATA[<h3>[React Native][React] call function inside .then async function got an error</h3><p>I have problem when i call SDK login with facebook with callback is data facebook user with access token , but in that case , i need call my API Authentication with that token, i have call inside .then async function, and it’s not working .</p><p>Here is my code :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gFDUhabjircooOMotJL0YQ.png" /></figure><p>And it got an error :</p><blockquote><em>Possible Unhandled Promise Rejection (id: 0):<br>TypeError: _this2._onLoginWithFacebook is not a function</em></blockquote><p>Function loginwithFacebook token not working .</p><h3>function defines `this` as the global object<br>(because it’s where the function is executed)</h3><h3>How to resolve ?</h3><p>This’s my new code :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euVUCGodCd6pJG_NAzmPbQ.png" /></figure><pre>keyword `this` represents instance of class.</pre><h3>Another way ?</h3><p>Define new variable in your function like that :</p><blockquote>var that = this;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bA9tPrv5oIyfHl1kbrRlQ.png" /></figure><h3>I don’t like this way …</h3><p>Hope it help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17a473ccf511" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[React Native]Refs - Using string literals in ref attributes is deprecated (react/no-string-refs)]]></title>
            <link>https://medium.com/@tungtran91/react-native-refs-using-string-literals-in-ref-attributes-is-deprecated-react-no-string-refs-cf5f8272389d?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf5f8272389d</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 09:00:14 GMT</pubDate>
            <atom:updated>2019-07-29T09:00:14.919Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Legacy API: String Refs</em></blockquote><blockquote><em>If you worked with React before, you might be familiar with an older API where the </em><em>ref attribute is a string, like </em><em>&quot;textInput&quot;, and the DOM node is accessed as </em><em>this.refs.textInput. We advise against it because string refs have </em><a href="https://github.com/facebook/react/pull/8333#issuecomment-271648615"><em>some issues</em></a><em>, are considered legacy, and </em><strong><em>are likely to be removed in one of the future releases</em></strong><em>. If you&#39;re currently using </em><em>this.refs.textInput to access refs, we recommend the callback pattern instead.</em></blockquote><p>For old version if you wanna access to one component and all property function in it and you use refs . Here’s example :</p><blockquote>&lt;ModelLoading</blockquote><blockquote>ref=”loadingComponent”</blockquote><blockquote>animated={false}</blockquote><blockquote>size={100}</blockquote><blockquote>showModel={true}</blockquote><blockquote>type={‘Bounce’}</blockquote><blockquote>color={‘#3FA2F7’}</blockquote><blockquote>/&gt;</blockquote><p>I have one model loading , and i wanna call that model show/hide popup a Model foreach call API .</p><blockquote>this.refs.loadingComponent.setModalVisible(false);</blockquote><p>But The Lint rule you are referring to is called no-string-refs and warns you with:</p><blockquote>“Using string literals in ref attributes is deprecated (react/no-string-refs)”</blockquote><h3>New ways</h3><blockquote>&lt;ModelLoading</blockquote><blockquote>ref={el =&gt; (this.loadingComponent = el)}</blockquote><blockquote>animated={false}</blockquote><blockquote>size={100}</blockquote><blockquote>showModel={true}</blockquote><blockquote>type={‘Bounce’}</blockquote><blockquote>color={‘#3FA2F7’}</blockquote><blockquote>/&gt;</blockquote><p>and foreach my call API , i using that code to show/hide model :</p><blockquote>this.loadingComponent.setModalVisible(false);</blockquote><p>Happy coding .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf5f8272389d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[React Native]Invariant Violation: Element type is invalid: expected a string( for built-in…]]></title>
            <link>https://medium.com/@tungtran91/react-native-invariant-violation-element-type-is-invalid-expected-a-string-for-built-in-95a6199f13e?source=rss-27ae06b72a10------2</link>
            <guid isPermaLink="false">https://medium.com/p/95a6199f13e</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[Tran Ngoc Tung]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 08:09:05 GMT</pubDate>
            <atom:updated>2019-07-29T08:09:05.509Z</atom:updated>
            <content:encoded><![CDATA[<h3>[React Native]Invariant Violation: Element type is invalid: expected a string( for built-in components) or a class/function..</h3><h3>Here’s full description:</h3><blockquote>Invariant Violation: Element type is invalid: expected a string( for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it’s defined in.</blockquote><p>How to resolve ?</p><ul><li>Adding export default</li><li>For example import using this code :</li></ul><blockquote>import ModelLoading from ‘../modals/ModelLoading’;</blockquote><p>instead of this :</p><blockquote>import { ModelLoading } from ‘../modals/ModelLoading’;</blockquote><p>In my case instead of exporting like this:</p><pre>export default App;</pre><p>…I exported like following:</p><pre>import ModelLoading from &#39;../modals/ModelLoading&#39;;</pre><p>It worked completely fine.</p><p>Hope it help ~.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95a6199f13e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>