How to write a babel plug-in for jsx?

var babel = require("babel-core");
var t = require("babel-types");

const visitor = {}

visitor.JSXElement = function(path) {
    ...
}

module.exports = function(babel) {
    return {
        visitor
    };
}
var babel = require("babel-core");

const result = babel.transform("<div>234</div>",{
  plugins:[
     require("./babel-jsx")
  ]
});

but an error is reported at run time. It is probably impossible to recognize

234 < / div >?

Mar.13,2021

what is written in your visitor


requires react jsx

const result = babel.transform("<div>234</div>",{
  presets: ['react'],
  plugins:[
     require("./babel-jsx")
  ]
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beca7b-14056.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beca7b-14056.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?