Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

How to use this in reactJs project in componentDidMount(){} methode? #157

Open

Description

@AnurajRicky
No description provided.

Activity

  1. beasteers commented on Nov 4, 2018

    @beasteers

    Something like this should work:

    import React from "react";
    import { Paper, Set, Rect } from 'react-raphael';
    import 'Raphael.FreeTransform';
    
    class Rectangle extends React.Component {
        onLoad = (element) => {
            this.transformer = element.paper.freeTransform(element);
        }
        componentWillUnmount() {
            this.transformer.unplug();
        }
        render() {
            return <Rect load={this.onLoad} />;
        }
    }
    ...

    You need to use the react-raphael load callback to access the element because it may not be loaded at the time of componentDidMount.

  2. kaleem-elahi commented on Feb 12, 2020

    @kaleem-elahi

    @AnurajRicky @beasteers Did this worked ?
    like importing like that "import 'Raphael.FreeTransform';".

    Thanks, do let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions