Skip to content

Force proxy update with functional component App #3

@mcallisto

Description

@mcallisto

Using hooks and FunctionalComponent, I changed in App.scala from
@react class App extends Component { ... }
to
@react object App {...}

Consequently I had to change in Main.scala from

    if (LinkingInfo.developmentMode) {
      hot.initialize()
      App.componentConstructor // required to force proxy update
    }
    
    AppRegistry.registerComponent("$name$", () => {
      App
    })

to

    if (LinkingInfo.developmentMode) {
      hot.initialize()
      App.component // @todo check if it is working
//      App.componentConstructor // required to force proxy update
    }

    AppRegistry.registerComponent("$name$", () => {
      App.component
    })

It compiles, but is it correct to force proxy update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions