Comments (3)
How to get A component id?can i set the id?
You can store the A component's id inside the B components' props
or custom
object considering the A component has already been created when you are creating the B component.
from craft.js.
you can subscribe the B component to the props update of A component:
function BComponent() {
const { store } = useEditor()
useEffect(() => {
const unsubscribe = store.subscribe(
state => {
return {
// you have to get the id of A component
props: state.nodes[idOfAComponent].data.props
}
},
collected => {
console.log(collected.props);
}
)
return () => unsubscribe();
}, [store])
// ...
}
from craft.js.
How to get A component id?can i set the id?
from craft.js.
Related Issues (20)
- isDeletable is inadequate - or just plain wrong.
- Selected node is reset when i interact with editor on production HOT 1
- Non string literal Element id result in corrupt json HOT 2
- Indicators not showing.
- Uncaught Error: Invariant failed: You can only use useNode in the context of <Editor />. HOT 11
- Simplified custom event handling HOT 1
- Form Input Fields for End users HOT 2
- Performance issue when i rendering a big page HOT 1
- intercepting dropped elements HOT 2
- Node with other nodes as children HOT 1
- Cannot update a component (`LayerContextProvider`) while rendering a different component (`Frame`)
- MJML output question
- useMultipleNode?
- multi select does not update layers
- Decouple @craftjs/layers with styled-components HOT 1
- Small typing issue when you enable strict null check
- change in props of any component is causing rerender for all other components
- How to use methods as a prop in craft js HOT 1
- Allowing type augmentation HOT 2
- A potential infinite loop in example landing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft.js.