/JSX.lua

Pure and complete Lua converter from JSX/TSX to JavaScript or TypeScript

Primary LanguageLuaGNU Affero General Public License v3.0AGPL-3.0

JSX.lua

Pure Lua converter from JSX/TSX to JavaScript or TypeScript using LPeg

Example

jsx:match([[
  return (
    <button onClick={() => this.setState({ liked: true })}>
      Like
    </button>
  );
]])

-- Returns: 
-- [[
--   return (
--     React.createElement("button", {"onClick": (() => this.setState({ liked: true }))}, "Like")
--   );
-- ]]