Skip to content

Doesn't detect changes for functions that generate DOM component changes #154

Description

@rob2d

I have a component which has a class. I have noticed that reloading does not work if a function contained in a component has code which is changed. Example:

class MainApp extends Component
{
    constructor(props)
    {
        super(props);

        this.DOM =
        {
            G :     // generator functions
            {
                contactButton : (p)=>
                {
                    return (
                        <Button className={this.classes.contactButtonContainer}
                            onClick={()=> {location.href = p.url}}>
                            <i className={p.className}/>
                        </Button>
                    );
                }
            }
        };
    }
    render ()
    {
        return (
                <div className="appWrapper">
                    <div className="mainContent">
                        <AppHeader/>
                        <div>- insert body content here -</div>
                    </div>
                    <div className="appFooter">
                        {this.DOM.G.contactButton(
                        {
                            className : 'mdi mdi-github-box',
                            url       : 'http://somewhere'
                        })}
                        {this.DOM.G.contactButton(
                            {
                                className : 'rc3 rc3-npm-box',
                                url       : 'http://somewhere'
                            })}
                        {this.DOM.G.contactButton(
                            {
                                className : 'mdi mdi-code-tags',
                                url              : 'http://somewhere''
                            })}
                    </div>
                </div>
                );
        }
}

If I edit the definition of this.DOM.G.contactButton, no changes are detected when reloading. Also to note, I am using Redux & ReactRouter (@next/latest for each). I was very careful to set up each and require the proper middleware, but I'm not sure if this is an issue with that at this point.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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