Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

children is undefined in when passed inside <Port> #185

Open
im-amir opened this issue Sep 29, 2022 · 1 comment
Open

children is undefined in when passed inside <Port> #185

im-amir opened this issue Sep 29, 2022 · 1 comment

Comments

@im-amir
Copy link
Contributor

im-amir commented Sep 29, 2022

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

When I pass anything as children inside the Port component, it just doesn't render those children.
Am I doing anything wrong? Please help.

<Canvas
...
...
node={(node) => {
   return (
    <Node
     dragType="port"
     port={<Port
      onEnter={(_event, port) => {// handle function}}
      onLeave={(_event, _port) =>{// handle function}}
      onDragStart={(_event, _pos, port) => {// handle function}}
      onDragEnd={(_event, _pos, _port) => {// handle function}}
      onClick={(event, port) => {// handle function}}
      rx={50}
      ry={50}
     >
        <text.           // <<<<<--------------------------------this does not render
         x={100}
         y={100}
         className='port-custom'
        >+</text>
     </Port>
     }
    >
      {(nodeProps) => {
            return (
             <foreignObject>
               <CustomHTML />
             </foreignObject>
             ...

I added a console.log inside Port.tsx, and it is undefined in the browser logs.
image
image

reaflow version: 5.0.7

Expected behavior

The text element should render when passed inside Port as a child.

Environment


Libs:
- react version: 18.1.0
- reaflow version: 5.0.7


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

@im-amir
Copy link
Contributor Author

im-amir commented Sep 30, 2022

@Vadorequest, regarding this PR that you created, please can you provide a working example (like codesandbox) of port children? That would be very helpful, I think I am doing something wrong maybe.
https://github.com/Vadorequest/rwa-faunadb-reaflow-nextjs-magic/pull/4/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant