Skip to content

[FEAT] make RouteChangeHandler opt-out #7148

@pcfreak30

Description

@pcfreak30

Is your feature request related to a problem? Please describe.

Add a refine config option that will make RouteChangeHandler in the Refine container opt-out.

I have been using it, but the v5 upgrade has caused it to change behaviors as currently in my app it loads such the default object is setup for the context and it return false, but the checking is run outside of the Router context for me due to architectural reasons. So my app has historically had RouteChangeHandler be a no-op. So the simplest action is to just not render it in the tree.

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

                            <UnsavedWarnContextProvider>
                              <React.Fragment>
                                {children}
                                {!disableTelemetryWithDefault && <Telemetry />}
                                <RouteChangeHandler />
                              </React.Fragment>
                            </UnsavedWarnContextProvider>

to

                            <UnsavedWarnContextProvider>
                              <React.Fragment>
                                {children}
                                {!disableTelemetryWithDefault && <Telemetry />}
                                {!disableRouteChangeHandler && <RouteChangeHandler />}
                              </React.Fragment>
                            </UnsavedWarnContextProvider>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions