Skip to content

Support react server components #2104

Answered by tony1658
danteissaias asked this question in Ideas
Discussion options

You must be logged in to vote

React Server components are in beta for now. I agree with benoitgrelard on revisiting this once a stable release has dropped.

For now you can create a wrapper around your components and put "use client" on top.

"use client"
import * as Checkbox from '@radix-ui/react-checkbox';
import { CheckIcon } from '@radix-ui/react-icons';
import '../globals.css';

export default function StyledCheckbox() {
  return (
    <form>
      <div style={{ display: 'flex', alignItems: 'center' }}>
        <Checkbox.Root className="CheckboxRoot" defaultChecked id="c1">
          <Checkbox.Indicator className="CheckboxIndicator">
            <CheckIcon />
          </Checkbox.Indicator>
        </Checkbox.Root>

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@danteissaias
Comment options

@benoitgrelard
Comment options

@tony1658
Comment options

Answer selected by benoitgrelard
@danteissaias
Comment options

@tony1658
Comment options

@ryendu
Comment options

@callum-gander
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2103 on April 24, 2023 13:40.