Fixed TS issues when used with single-spa-react
#4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Hi there! 👋
For a private project, we're using the
single-spa-react
package, and wanted to use this new helper package to not have to reproduce the logic to mount a parcel. It's working as expected, but as we are using Typescript for this project, it is complaining that the definitions fordomElementGetter
betweensingle-spa-react
anddom-element-getter-helpers
don't match. For reference, here's the definition fromsingle-spa-react
. I think the React ecosystem is the only one that passes props to this function.Since the
domElementGetter
now takes an optionalprops
parameter, it should still work as expected for other ecosystems that don't pass it. We've tested it in our project and the Typescript issue has disappeared.All the tests are passing, there's no formatting issue and the project builds successfully.
Also, thank you for
single-spa
and all the helpers, it's awesome!Changes
domElementGetter
function to take optional props