This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Replace propTypes
with TypeScript definitions
#9679
Closed
Closed
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9cf7d0c
defining types for ActiveFiltersBlockProps
Sadaf-A 15e637a
adding comments to eah field in ActiveFiltersBlockProps
Sadaf-A 09548c1
code fix
Sadaf-A dc96c13
Merge branch 'trunk' into trunk
nielslange 69e304a
refactoring
Sadaf-A 52875d7
Merge branch 'trunk' of https://github.com/Sadaf-A/woocommerce-blocks…
Sadaf-A 2a23d81
Merge branch 'trunk' into trunk
nielslange 388ce0d
using keyword in imports, refactoring
Sadaf-A c4b6255
Merge branch 'trunk' into trunk
nielslange 106eebd
Merge branch 'trunk' into trunk
nielslange 4db2368
Merge branch 'trunk' into trunk
nielslange f03f074
Merge branch 'trunk' into trunk
nielslange d3a7888
Merge branch 'trunk' into trunk
nielslange File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,14 @@ export interface Attributes { | |
displayStyle: string; | ||
className?: string; | ||
} | ||
|
||
export interface ActiveFiltersBlockProps { | ||
/** | ||
* The attributes for this block. | ||
*/ | ||
attributes: Attributes; | ||
/** | ||
* Whether it's in the editor or frontend display. | ||
*/ | ||
isEditor: boolean; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better if we change export interface Attributes {
heading: string;
headingLevel: number;
displayStyle: string;
className?: string;
}
export interface ActiveFiltersBlockProps {
/**
* The attributes for this block.
*/
attributes: Attributes;
/**
* Whether it's in the editor or frontend display.
*/
isEditor: boolean;
} to export interface ActiveFiltersBlockProps {
heading: string;
headingLevel: number;
displayStyle: string;
className?: string;
isEditor?: boolean;
} That way, it's consistent with the other components. The definition |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
import type { ActiveFiltersBlockProps } from './types';
instead ofimport { ActiveFiltersBlockProps } from './types';
leads to a faster compile time. I'd say we should do that in this case, given thatActiveFiltersBlockProps
is a type that we're importing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure! thanks for the explanation this is valuable information.