0

having a really strange issue where components that are imported into app.js, do not refresh/reload when changes are made to them, but changes made to app.js are reflected in the simulator and my phone.

So if I change something in the navigation component, nothing happens. If i change the ActionBar title, the change is reflected but the first change made in navigation is still not.

That only takes effect if I reload the whole project.

<template>
    <Page>
        <ActionBar title="Welcome to the Shop"/>
        <GridLayout columns="*" rows="*">
            <Label class="message" :text="msg" col="0" row="0"/>
            <navigation></navigation>
        </GridLayout>
    </Page>
</template>

<script>
import navigation from '@/components/navigation/Master.vue';

  export default {
    components: {
        'navigation': navigation
    },
    data() {
      return {
        msg: 'Hello World! This is Big D.'
      }
    }
  }
</script>
5
  • Could u explain what changes u tried to make in navigation component? And if possible, post the navigation component code too! Commented May 17, 2020 at 18:50
  • Hi @KarthikArwin, the change was extremely simple. I have a bottom navigation with 3 tables - Shop, Favourites, Settings. If I change the label name from Shop to Shops, the change is not reflected/hot reloaded. I'm still new to NativeScript so I'm not doing anything advanced or complex. Just trying to get a feel for the platform. Commented May 17, 2020 at 18:53
  • Oh Got it! Actually Webpack used to watch for those changes in Nativescript and it hasn't become matured in re rendering the native elements. I face this problem often too! And I observed that this used to happen for people whose tutorials i used to watch even. And if u add or remove any files at ur applications, u need to delete the platform folder and run the tns run command. But I would recommend u to use Sidekick as it used HMR, it works better than the normal tns cli. It's lot more comfortable to use. here's the link nativescript.org/nativescript-sidekick Commented May 17, 2020 at 19:02
  • 1
    Hi @KarthikArwin, thanks a lot mate, Sidekick has worked perfectly and now my component is rendering changes fine. It's so weird how this wasn't working when running the project from terminal command. I'm still toying whether to do my next project in NativeScript or Flutter and I actually just switched over to learning Flutter as this issue - which I would consider "minor" made me look at a NativeScript as an unstable platform. The reason I would like to use NativeScript is due to my extensive experience with Vue. Commented May 17, 2020 at 19:18
  • @KarthikArwin if you post your last message as an answer, I'll mark it as correct as it has solved my issue. Commented May 17, 2020 at 19:21

1 Answer 1

1

Actually Webpack used to watch for those changes in Nativescript and it hasn't become matured in re rendering the native elements. I face this problem often too! And I observed that this used to happen for people whose tutorials i used to watch even.

And if u add or remove any files at ur applications, u need to delete the platform folder and run the tns run command.

But I would recommend u to use Sidekick as it used HMR, it works better than the normal tns cli. It's lot more comfortable to use. here's the link SideKick

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.