Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Allow to pass config with history#32

Open
cursedcoder wants to merge 1 commit intotrialspark:masterfrom
cursedcoder:feature/react-router-config
Open

Allow to pass config with history#32
cursedcoder wants to merge 1 commit intotrialspark:masterfrom
cursedcoder:feature/react-router-config

Conversation

@cursedcoder
Copy link
Copy Markdown

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

This introduces config to react3 router, so tests now can be run using any external history.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.06%) to 97.189% when pulling 0ae27d3 on cursedcoder:feature/react-router-config into 4bb126c on trialspark:master.

@minznerjosh
Copy link
Copy Markdown
Contributor

Thanks for the PR! Can you provide some more context on your use-case for this feature? Why is the MemoryHistory that the react-router plugin creates for you not working?

@cursedcoder
Copy link
Copy Markdown
Author

I want to test the whole application without changing any components it uses.
In my case replacing hashHistory with memoryHistory introduces different behavior during testing.

Take aside my case, you can see this code looks like it is doing too much under the hood without external input. I think package users should have a little bit more control over that.

@cursedcoder
Copy link
Copy Markdown
Author

For anyone curious about workaround, here is a snippet without typescript https://gist.github.com/cursedcoder/a222884a8e13ec3c66ff82857ec171bf

@cursedcoder
Copy link
Copy Markdown
Author

@minznerjosh any news?

Copy link
Copy Markdown
Contributor

@minznerjosh minznerjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the ridiculous delay! Let's ship this! Can you just update the docs to include this new configuration option?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants