Giter VIP home page Giter VIP logo

Comments (5)

moklick avatar moklick commented on August 13, 2024 4

Hey,

we didn't exported all types. You should now be able to import the Position enum:

import { Handle, Position } from 'react-flow-renderer';

const HandleWithPosTop = (
  <Handle 
    position={Position.Top}
  />
);

This should work with v.1.3.7

from react-flow.

andys8 avatar andys8 commented on August 13, 2024

I ran into the same issue. I believe the fix should work. Thanks.

from react-flow.

jeremypeters avatar jeremypeters commented on August 13, 2024

Hi @moklick

I updated to 1.3.7 and I'm getting a couple more errors using your fix:

Module '"../../../node_modules/react-flow-renderer/dist"' has no exported member 'Position'. Did you mean to use 'import Position from "../../../node_modules/react-flow-renderer/dist"' instead?ts(2614)

TS2322: Type '{ type: "target"; position: Position.Top; className: string; }' is not assignable to type 'IntrinsicAttributes & HandleProps'. Property 'className' does not exist on type 'IntrinsicAttributes & HandleProps'.

from react-flow.

moklick avatar moklick commented on August 13, 2024

hey @jeremypeters,

I set up a codesandbox with example ts code:

https://codesandbox.io/s/react-flow-customnode-ts-lu18j?file=/src/Flow.tsx

className is not a prop type of the Handle component and Position gets exported since the last version. Does the code example help you to solve this or is there still an issue with the library?

from react-flow.

moklick avatar moklick commented on August 13, 2024

Hey

from react-flow.

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.