scratchfoundation / scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
https://scratch.mit.edu/developers
Apache License 2.0
2.55k stars 1.36k forks source link

scratch-blocks in react application. #3012

Open asadgulxar opened 1 year ago

asadgulxar commented 1 year ago

How can we use scratch block in react typescript application? can you please provide a code snippet of a react component that uses scratch-blocks?

Elsper01 commented 5 months ago

Here is a small snippet how to use scratch-blocks in react typescript:

import scratchblocks from 'scratchblocks';
import ScratchBlocks from 'scratchblocks-react';

const ScratchBlocksImage = props => (
    <div>
        <ScratchBlocks
            blockStyle="scratch3"
            languages={['en']}
        >
            {scratchBlocksText}
        </ScratchBlocks>
    </div>
);

ScratchBlocksImage.propTypes = {
    scratchBlocksText: PropTypes.string
};
mxmou commented 5 months ago

Here is a small snippet how to use scratch-blocks in react typescript:

That's scratchblocks, not scratch-blocks.