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

as Prop doesn't work #13

Open
estefigj opened this issue Jan 19, 2023 · 0 comments
Open

as Prop doesn't work #13

estefigj opened this issue Jan 19, 2023 · 0 comments

Comments

@estefigj
Copy link

Hi! I'm trying to use as Prop -> documentation here <- but it doesn't work.

I have this StyledComponent:

export const Text = styled.div`
    color: #333333;
    font-size: 1.5rem;
`;
export class TheText {
	@Prop() text: string;
	@Prop() taghtml: string;

	render() {
		return (
			<Host>
				<Text as={this.taghtml}>{this.text}</Text>
			</Host>
		);
	}
}

I use TheText component:

<the-text text="Hi! I'm a text" taghtml="p"/>

And the DOM always show the tag: div

<the-text text="Hi! I'm a text" taghtml="p">
	<div>Hi! I'm a text</div>
</the-text>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant