Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Set return types to JSX.Element
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Apr 28, 2021
1 parent e94c27d commit 8f72c97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ShippingCalculatorAddress = ( {
address: initialAddress,
onUpdate,
addressFields,
}: ShippingCalculatorAddressProps ) => {
}: ShippingCalculatorAddressProps ): JSX.Element => {
const [ address, setAddress ] = useState( initialAddress );
const {
hasValidationErrors,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import PropTypes from 'prop-types';
import { useShippingDataContext } from '@woocommerce/base-context';
import type { Address } from '@woocommerce/type-defs/customer';

Expand All @@ -21,7 +20,7 @@ const ShippingCalculator = ( {
/* Do nothing */
},
addressFields = [ 'country', 'state', 'city', 'postcode' ],
}: ShippingCalculatorProps ) => {
}: ShippingCalculatorProps ): JSX.Element => {
const { shippingAddress, setShippingAddress } = useShippingDataContext();
return (
<div className="wc-block-components-shipping-calculator">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ interface ShippingLocationProps {
* @param {Object} props Incoming props for the component.
* @param {Object} props.address Incoming address information.
*/
const ShippingLocation = ( { address }: ShippingLocationProps ) => {
const ShippingLocation = ( {
address,
}: ShippingLocationProps ): JSX.Element | null => {
// we bail early if we don't have an address.
if ( Object.values( address ).length === 0 ) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ShippingRatesControl = ( {
collapsible = false,
noResultsMessage,
renderOption,
}: ShippingRatesControlProps ) => {
}: ShippingRatesControlProps ): JSX.Element => {
useEffect( () => {
if ( shippingRatesLoading ) {
return;
Expand Down

0 comments on commit 8f72c97

Please sign in to comment.