Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native: Fix errors on compose story #25906

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/lib/preview-api/src/modules/preview-web/UrlStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getFirstString = (v: ValueOf<qs.ParsedQs>): string | void => {
};

export const getSelectionSpecifierFromPath: () => SelectionSpecifier | null = () => {
const query = qs.parse(document.location.search, { ignoreQueryPrefix: true });
const query = qs.parse(document?.location?.search, { ignoreQueryPrefix: true });
const args = typeof query.args === 'string' ? parseArgsParam(query.args) : undefined;
const globals = typeof query.globals === 'string' ? parseArgsParam(query.globals) : undefined;

Expand Down
2 changes: 1 addition & 1 deletion code/lib/preview-api/src/modules/preview-web/WebView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class WebView implements View<HTMLElement> {
constructor() {
// Special code for testing situations
// eslint-disable-next-line @typescript-eslint/naming-convention
const { __SPECIAL_TEST_PARAMETER__ } = qs.parse(document.location.search, {
const { __SPECIAL_TEST_PARAMETER__ } = qs.parse(document?.location?.search, {
ignoreQueryPrefix: true,
});
switch (__SPECIAL_TEST_PARAMETER__) {
Expand Down
Loading