Feat(nodes): add initialWidth and initialHeight (#3953)
* feat(react/svelte): add initialWidth/initialHeight closes #3793 * chore(packages): update changelogs
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { memo, useState } from 'react';
|
||||
import { Handle, Position } from '@xyflow/react';
|
||||
|
||||
function CustomNode() {
|
||||
const [text, setText] = useState('this is a pretty long text');
|
||||
|
||||
return (
|
||||
<>
|
||||
<Handle type="target" position={Position.Top} />
|
||||
<div style={{ background: '#eee', padding: 10 }}>
|
||||
<div>
|
||||
<input value={text} onChange={(e) => setText(e.target.value)} />
|
||||
<div>text: {text}</div>
|
||||
</div>
|
||||
</div>
|
||||
<Handle type="source" position={Position.Bottom} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(CustomNode);
|
||||
Reference in New Issue
Block a user