Skip to content

Commit

Permalink
feat: rename root element mounted during render
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Feb 5, 2024
1 parent e14bb85 commit 0597771
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<div id="zebar"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/app/group-element.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export function GroupElement(props: GroupElementProps) {

return (
<div
id={toCssSelector(config.id)}
class={config.class_names.join(' ')}
id={toCssSelector(config.id)}
>
<Index each={getChildIds(rawConfig)}>
{childId => (
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/app/template-element.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function TemplateElement(props: TemplateElementProps) {

function createRootElement() {
const element = document.createElement('div');
element.id = toCssSelector(config.id);
element.className = config.class_names.join(' ');
element.id = toCssSelector(config.id);
return element;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/app/window-element.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export function WindowElement() {
<Show when={context()}>
{context => (
<div
id={toCssSelector(context().parsedConfig.id)}
class={context().parsedConfig.class_names.join(' ')}
id={toCssSelector(context().parsedConfig.id)}
>
<Index each={getChildIds(context().rawConfig)}>
{childId => (
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ html {
box-sizing: border-box;
}

#root {
#zebar {
height: 100vh;
width: 100vw;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import './normalize.scss';
import './index.scss';
import { WindowElement } from './app/window-element.component';

const root = document.getElementById('root');
const root = document.getElementById('zebar');

if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
throw new Error('Root element not found.');
Expand Down

0 comments on commit 0597771

Please sign in to comment.