Skip to content

Commit

Permalink
feat: Add stable id.setBaseId method
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Jul 14, 2020
1 parent 0d96bc0 commit 101b98d
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/reakit/src/Composite/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const COMPOSITE_STATE_KEYS = [
"baseId",
"unstable_idCountRef",
"unstable_setBaseId",
"setBaseId",
"unstable_virtual",
"rtl",
"orientation",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Dialog/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DIALOG_STATE_KEYS = [
"visible",
"animated",
"animating",
"unstable_setBaseId",
"setBaseId",
"show",
"hide",
"toggle",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Disclosure/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DISCLOSURE_STATE_KEYS = [
"visible",
"animated",
"animating",
"unstable_setBaseId",
"setBaseId",
"show",
"hide",
"toggle",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Form/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const FORM_STATE_KEYS = [
"submitting",
"submitSucceed",
"submitFailed",
"unstable_setBaseId",
"setBaseId",
"reset",
"validate",
"submit",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Grid/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const GRID_STATE_KEYS = [
"unstable_moves",
"unstable_angular",
"unstable_hasActiveWidget",
"unstable_setBaseId",
"setBaseId",
"registerItem",
"unregisterItem",
"registerGroup",
Expand Down
5 changes: 2 additions & 3 deletions packages/reakit/src/Id/IdState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type unstable_IdActions = {
/**
* Sets `baseId`.
*/
unstable_setBaseId: React.Dispatch<React.SetStateAction<string>>;
setBaseId: React.Dispatch<React.SetStateAction<string>>;
};

export type unstable_IdInitialState = Partial<Pick<unstable_IdState, "baseId">>;
Expand All @@ -36,10 +36,9 @@ export function unstable_useIdState(
const [baseId, setBaseId] = React.useState(
() => initialBaseId || generateId()
);

return {
baseId,
unstable_setBaseId: setBaseId,
setBaseId,
unstable_idCountRef: idCountRef,
};
}
6 changes: 1 addition & 5 deletions packages/reakit/src/Id/__keys.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Automatically generated
const ID_STATE_KEYS = [
"baseId",
"unstable_idCountRef",
"unstable_setBaseId",
] as const;
const ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"] as const;
export const ID_KEYS = [...ID_STATE_KEYS, "id"] as const;
2 changes: 1 addition & 1 deletion packages/reakit/src/Menu/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const MENU_BAR_STATE_KEYS = [
"unstable_angular",
"unstable_hasActiveWidget",
"unstable_values",
"unstable_setBaseId",
"setBaseId",
"registerItem",
"unregisterItem",
"registerGroup",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Popover/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const POPOVER_STATE_KEYS = [
"visible",
"animated",
"animating",
"unstable_setBaseId",
"setBaseId",
"show",
"hide",
"toggle",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Radio/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const RADIO_STATE_KEYS = [
"unstable_angular",
"unstable_hasActiveWidget",
"state",
"unstable_setBaseId",
"setBaseId",
"registerItem",
"unregisterItem",
"registerGroup",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Rover/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ROVER_STATE_KEYS = [
"unstable_pastId",
"unstable_moves",
"loop",
"unstable_setBaseId",
"setBaseId",
"register",
"unregister",
"move",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Tab/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const TAB_STATE_KEYS = [
"selectedId",
"panels",
"manual",
"unstable_setBaseId",
"setBaseId",
"registerItem",
"unregisterItem",
"registerGroup",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Toolbar/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TOOLBAR_STATE_KEYS = [
"unstable_moves",
"unstable_angular",
"unstable_hasActiveWidget",
"unstable_setBaseId",
"setBaseId",
"registerItem",
"unregisterItem",
"registerGroup",
Expand Down
2 changes: 1 addition & 1 deletion packages/reakit/src/Tooltip/__keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const TOOLTIP_STATE_KEYS = [
"visible",
"animated",
"animating",
"unstable_setBaseId",
"setBaseId",
"show",
"hide",
"toggle",
Expand Down

0 comments on commit 101b98d

Please sign in to comment.