feat: cls2fn

This commit is contained in:
Hoikan 2024-04-10 17:58:16 +08:00
parent bf90ea1b7f
commit 7b4c3a35d0
1 changed files with 1 additions and 5 deletions

View File

@ -3,10 +3,6 @@ import * as babel from '@babel/core';
import { Option } from './types';
import type { Scope } from '@babel/traverse';
const DECORATOR_PROPS = 'Prop';
const DECORATOR_CHILDREN = 'Children';
const DECORATOR_WATCH = 'Watch';
function replaceFnWithClass(path: NodePath<t.FunctionDeclaration>, classTransformer: ClassComponentTransformer) {
const originalName = path.node.id.name;
const tempName = path.node.id.name + 'Temp';
@ -208,7 +204,7 @@ class ClassComponentTransformer {
/**
* transform node to watch label to watch decorator
* e.g.
*
*
* watch: console.log(state)
* // transform into
* @Watch