Skip to content

Commit

Permalink
React compatibility: Changing global JSX namespace to React.JSX (#38585)
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-karen authored and matticbot committed Jul 30, 2024
1 parent 26e41ae commit 60c9da1
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 89 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is an alpha version! The changes listed here are not final.
- Admin bar: Force mobile viewport to have the same icon color as desktop
- Blog Privacy: Update Applebot-Extended disallow rule
- Hide the plugin banner on non-wpcom-connected users or agency-managed users
- React: Changing global JSX namespace to React.JSX

### Fixed
- Admin Bar: Fix the order of the top-right items on Atomic sites
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-url'), 'version' => 'b515758ac27e45334920');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-url'), 'version' => 'f218072b4f6c868afcae');

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { localizeUrl } from '@automattic/i18n-utils';
import { createInterpolateElement } from '@wordpress/element';
import { addFilter } from '@wordpress/hooks';
import { JSXElementConstructor, ReactElement } from 'react';
import React from 'react';
import blockInfoMapping, {
blockInfoWithVariations,
childrenBlockInfoWithDifferentUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useAnalytics } from '@automattic/jetpack-shared-extension-utils';
import { Button, ExternalLink } from '@wordpress/components';
import { useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import React from 'react';
import { useState, JSXElementConstructor, ReactElement } from 'react';

interface Props {
Expand All @@ -27,7 +28,7 @@ export default function DescriptionSupportLink( {
title,
url,
postId,
}: Props ): JSX.Element {
}: Props ): React.JSX.Element {
// This was cooked up to only apply the link in the BlockEditor sidebar.
// Since there was no identifier in the environment to differentiate.
const [ ref, setRef ] = useState< Element | null >();
Expand All @@ -37,7 +38,7 @@ export default function DescriptionSupportLink( {
const setShowSupportDoc = helpCenterDispatch?.setShowSupportDoc;

if ( ref && ! ref?.closest( '.block-editor-block-inspector' ) ) {
return children as JSX.Element;
return children as React.JSX.Element;
}

return (
Expand Down
Loading

0 comments on commit 60c9da1

Please sign in to comment.