Skip to content
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

Use Expo DOM #131

Open
julienqueffelec opened this issue Feb 4, 2025 · 2 comments
Open

Use Expo DOM #131

julienqueffelec opened this issue Feb 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@julienqueffelec
Copy link

julienqueffelec commented Feb 4, 2025

Description of the bug

use DOM expos in monorepo

To Reproduce

  1. Create a web component
'use dom';

import React from 'react';

export default function WebComponent() {
  return (
    <div
      style={{
        padding: 16,
      }}
    >
      <h1 style={{ color: 'black' }}>Hello world</h1>
    </div>
  );
}
  1. import it in the homepage
import { Paragraph, Strong } from '@acme/ui';

import { ComponentProps } from 'react';

import WebComponent from './WebComponent';

type HomeMessageProps = ComponentProps<typeof Paragraph>;

export const HomeMessage = (props: HomeMessageProps) => (
  <Paragraph {...props}>
    Hello from an <Strong>Expomonorepo</Strong>!
    <WebComponent />
  </Paragraph>
);
  1. Launch metro server.

Expected behavior

See the web component

Actual behavior

Nothing show on screen.

I can see "DOM Bundled" in the metro logs.

@julienqueffelec julienqueffelec added the bug Something isn't working label Feb 4, 2025
@byCedric
Copy link
Owner

byCedric commented Feb 5, 2025

Hi @julienqueffelec! I can't seem to reproduce the issue, is it possible to send me your project code as is? In the example below, I've used the command pnpm run dev:example in the monorepo root.

Image

@byCedric
Copy link
Owner

byCedric commented Feb 6, 2025

Re: https://x.com/julienqueffelec/status/1887127958982213911

This should work on initial screens as well:

expo-monorepo-dom.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants