GithubHelp home page GithubHelp logo

Comments (4)

chrvadala avatar chrvadala commented on May 17, 2024

The uncontrolled behaviour is already builtin

from react-svg-pan-zoom.

chrvadala avatar chrvadala commented on May 17, 2024

Probably is better to split controlled and uncontrolled component

from react-svg-pan-zoom.

chrvadala avatar chrvadala commented on May 17, 2024

Requirements:
ReactSVGPanZoom should become an exported component that works as PureComponent. It doesn't have any state. It requires value, onChangeValue, tool, onChangeTool as prop types. The file for this component is src/viewer.js

UncontrolledReactSVGPanZoom is a new exported component that works as the current viewer and internally handle the tool and value states. The file for this component should be src/uncontrolled-viewer.js

The developer can't no more handle half component state. For example, actually a developer can have a controlled tool state and uncontrolled value state. In the new version this option won't be no more available.

Deprecations:
The controlled component has this deprecated methods: getValue, getTool. Call these methods should show a console.warn message that alerts the user about the deprecation.

A good reference for uncontrolled component is the awesome Reacstrap component library

from react-svg-pan-zoom.

chrvadala avatar chrvadala commented on May 17, 2024

Done. Will be released with 3.0

from react-svg-pan-zoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.