nbudin / react-blockly

A React component that embeds a Blockly visual programming editor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use this Component?

Daltsz opened this issue · comments

Hello, I have one question, because I'm very confused about how to use this component ReactBlockly.

I install in my react app but I would like to use the ReactBlockly component inside of a specific page of my site.

I create the page but when I call the component don't appear anything

Please help me because I'm a noob

Hi Gabriel, as I mentioned on the Blockly mailing list, filing an issue on this project is not a good way to ask for help. It's better to ask on the mailing list instead, because other people besides me read it and can help you.

That being said, and to answer your question in #22, Webpack is the easiest way to include this component in your project. While it's theoretically possible to build React applications without Webpack, using Webpack is by far the best-documented and most-travelled path for React applications. In fact, if you start by using create-react-app, it will actually be using Webpack under the covers.

Once you have a working Webpack build, it should be possible to install react-blockly into your project using either npm or yarn (depending on which package manager you are using for your project) and then you can do something like:

import ReactBlockly from 'react-blockly';

function MyComponent() {
  return <ReactBlockly {...whateverPropsYouWantToUseForBlockly} />
}

thanks, Nbudin I will post my questions in the Blockly mailing list and I will install the webpack in my project