Skip to content

refactor: Select samples update for react 19 #825

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

Open
wants to merge 1 commit into
base: vnext
Choose a base branch
from
Open
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
10 changes: 1 addition & 9 deletions samples/inputs/select/group/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import React, { useEffect } from "react";
import ReactDOM from "react-dom/client";
import {
IgrSelectModule,
IgrSelectItemModule,
IgrIconModule,
IgrSelect,
IgrSelectItem,
IgrIcon,
IgrSelectGroupModule,
IgrSelectGroup,
registerIconFromText,
} from "igniteui-react";
import "./index.css";
import "igniteui-webcomponents/themes/light/bootstrap.css";

IgrSelectModule.register();
IgrSelectGroupModule.register();
IgrSelectItemModule.register();
IgrIconModule.register();

const placeSvg =
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z"/></svg>';
Expand Down Expand Up @@ -117,6 +109,6 @@ export default function SelectGroup() {
);
}

// rendering above class to the React DOM
// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<SelectGroup />);
9 changes: 1 addition & 8 deletions samples/inputs/select/header/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import React from "react";
import ReactDOM from "react-dom/client";
import {
IgrSelectModule,
IgrSelectHeaderModule,
IgrSelectItemModule,
IgrSelect,
IgrSelectItem,
IgrSelectHeader
} from "igniteui-react";
import "igniteui-webcomponents/themes/light/bootstrap.css";

IgrSelectModule.register();
IgrSelectHeaderModule.register();
IgrSelectItemModule.register();

export default function SelectHeader() {
return (
<div className="sample">
Expand All @@ -28,6 +21,6 @@ export default function SelectHeader() {
);
}

// rendering above class to the React DOM
// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<SelectHeader />);
8 changes: 1 addition & 7 deletions samples/inputs/select/item/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { useEffect } from "react";
import ReactDOM from "react-dom/client";
import {
IgrSelectModule,
IgrSelectItemModule,
IgrIconModule,
IgrSelect,
IgrSelectItem,
IgrIcon,
Expand All @@ -12,9 +9,6 @@ import {
import "./index.css";
import "igniteui-webcomponents/themes/light/bootstrap.css";

IgrSelectModule.register();
IgrSelectItemModule.register();
IgrIconModule.register();

const hotelSvg =
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 14c1.66 0 3-1.34 3-3S8.66 8 7 8s-3 1.34-3 3 1.34 3 3 3zm0-4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm12-3h-8v8H3V5H1v15h2v-3h18v3h2v-9c0-2.21-1.79-4-4-4zm2 8h-8V9h6c1.1 0 2 .9 2 2v4z"/></svg>';
Expand Down Expand Up @@ -57,6 +51,6 @@ export default function SelectItem() {
);
}

// rendering above class to the React DOM
// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<SelectItem />);
6 changes: 2 additions & 4 deletions samples/inputs/select/overview/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { IgrSelectModule, IgrSelectItemModule, IgrSelect, IgrSelectItem } from "igniteui-react";
import { IgrSelect, IgrSelectItem } from "igniteui-react";
import "igniteui-webcomponents/themes/light/bootstrap.css";

IgrSelectModule.register();
IgrSelectItemModule.register();

export default function SelectOverview() {
return (
Expand All @@ -19,6 +17,6 @@ export default function SelectOverview() {
);
}

// rendering above class to the React DOM
// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<SelectOverview />);
11 changes: 1 addition & 10 deletions samples/inputs/select/styling/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import React, { useEffect } from "react";
import ReactDOM from "react-dom/client";
import {
IgrSelectModule,
IgrSelectItemModule,
IgrIconModule,
IgrSelect,
IgrSelectItem,
IgrIcon,
IgrSelectGroupModule,
IgrSelectGroup,
registerIconFromText,
} from "igniteui-react";
import "./index.css";
import "igniteui-webcomponents/themes/light/bootstrap.css";

IgrSelectModule.register();
IgrSelectGroupModule.register();
IgrSelectItemModule.register();
IgrIconModule.register();

const placeSvg =
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14zM12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2z"/></svg>';

Expand Down Expand Up @@ -90,6 +81,6 @@ export default function SelectGroup() {
);
}

// rendering above class to the React DOM
// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<SelectGroup />);