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

conditional statements don't work unless wrapped in brackets. is this supposed to happen? #121

Open
catalin560 opened this issue May 10, 2023 · 1 comment

Comments

@catalin560
Copy link

copy pasted from docs:

<If condition={true}>
        <h1>IfBlock</h1>
      </If>

will render in my page like so:
Screenshot 2023-05-10 at 14-09-20 Ionic App

only after I wrap the block in brackets it will work as expected:

{
<If condition={true}>
        <h1>IfBlock</h1>
      </If>
}

will render normally...

looking thru the docs I assumed I didn't need to wrap these blocks in brackets, am I missing something?
my project is running the latest vite with the @vitejs/plugin-react plugin, my vite.config.js looks like so:

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react({ babel: { plugins: ["macros", "jsx-control-statements"] } })],
  server: {
    hmr: false
  }
});
@AlexGilleran
Copy link
Owner

AlexGilleran commented May 10, 2023 via email

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

2 participants