Accept custom form link as alternative to form id #6
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.
Adds a
customFormLinkoption so you can embed forms by their custom share URL (e.g.https://fillout.com/my-custom-form) rather than only byfilloutId. This avoids having to memorize opaque IDs and makes your embed code more meaningful.I like using the custom share link feature to organize my forms. Unfortunately, the form react components don't support referencing a form by a custom link.
This feature adds another option,
customFormLink, by which forms can be referenced. Usage example:I added an exclusive OR to the type which is used by the components. This provides intellisense to warn users not to pass both identifiers simultaneously (though this does not throw an error). Internally, the
useFilloutEmbedhook uses a union of the two configuration options. There are other ways I could do this but I wanted to avoid making more changes than necessary.I also made some alterations to the README to accommodate the new identifier.
This feature would be a great QoL for my workflow so that I could remember which form is which. Please let me know if you'd like anything changed.