This talk has been presented at React Day Berlin 2023, check out the latest edition of this React Conference.
Video: Hacking JSX: Building in Minecraft with React
The video explores how JSX, a syntax extension for JavaScript that resembles HTML, can be used to create builds in Minecraft. By leveraging the familiarity of JSX, developers can create a custom domain-specific language (DSL) for Minecraft, making it easier to convert JSX syntax into game commands. This approach eliminates the need for custom parsers and allows for the use of existing tools for linting and IDE support. The apply build function in JSX is akin to mounting a React tree to an HTML DOM, transforming JSX builds into game elements. By running the app with Bun, developers can enjoy real-time rendering of their builds. The video encourages viewers to share their JSX creations and highlights the availability of the project’s source code on GitHub. The talk also touches on the role of the react.createElement() function, which is what JSX is transpiled into when using React, and how JSX can be used outside of React with custom handlers. The coordinates system in Minecraft, which uses x, y, and z for placing blocks, is also discussed.
Available in other languages:
Check out more articles and videos
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Comments