Comments (9)
Ok, so I found the culprit, if you have an event listener, it stops updating with jsx version (or when using plain createVNode
instead of h
). Same repo codesandbox
from babel-plugin-jsx.
from babel-plugin-jsx.
It seems it uses createVNode
, which does not work in this case I guess?
from babel-plugin-jsx.
import {
ref, Transition, createApp, defineComponent,
} from 'vue';
const MyTransition = (_, { slots }) => (
<Transition>{slots.default()}</Transition>
);
const App = defineComponent({
setup() {
const isOpen = ref(false);
setInterval(() => { isOpen.value = !isOpen.value; }, 1000);
return () => <MyTransition>{isOpen.value && <h1>Visible</h1>}</MyTransition>;
},
});
It works.
try
const MyTransition = (_, { slots }) => (
<Transition>{slots.default()}</Transition>
);
from babel-plugin-jsx.
It seems it does not have anything to do with a hoc, I made a reproduction codesandbox red text is vue h
, bluetext is jsx. Main code is in /src/Toggle.vue. I tried reproducing it with my use case so it could be a bit more than actually necessary for it to start failing.
Edit: wait, just noticed that it works the other way around which is strange. In my local case jsx is the one not working, in codesandbox it's vue that is not working... this is so confusing :|
Edit 2: something is really messed up, now they both work...
from babel-plugin-jsx.
I'll just close this until I get what is going on, sorry for wasting your time ๐
from babel-plugin-jsx.
I'll just close this until I get what is going on, sorry for wasting your time ๐
It's fine. Thanks for your issue.
from babel-plugin-jsx.
Seems to work with the fix ๐
from babel-plugin-jsx.
v1.0.0-beta.4
from babel-plugin-jsx.
Related Issues (20)
- [Question] In the future and Object slot typing be supported by this plugin HOT 2
- [Question] How to pass function slots ๏ผ HOT 1
- [BUG] empty string transform to true
- Action Required: Fix Renovate Configuration
- [BUG] empty string transform to true HOT 2
- [Question] How to pass any attribute to the component HOT 2
- [BUG] Excluding a file will prevent it from still getting parsed as JSX causing errors
- Can this plugin be used in a browser? HOT 1
- vModel ไฟฎ้ฅฐ็ฌฆไธ่ฝๅจๆ HOT 2
- [BUG] {} ๆธฒๆๅผๅธธ HOT 1
- [BUG] tsup bundle problem HOT 2
- [BUG] Typescript typings HOT 1
- [BUG] "resolveDirective" is imported from external module "vue" but never used
- [Question] Help้ ็ฝฎๅ่กจ HOT 1
- [Question] directives:v-model or vModel?v-show or vShow? HOT 1
- [BUG] Report bug HOT 1
- [Question] how to make vue jsx ast return to jsx HOT 1
- [Question] How to set a Symbolic Link in README.md HOT 2
- The inline style setting failed HOT 1
- When JSX is used, v-slots cause child component does unnecessary rendering during parent component re-rendering HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-jsx.