-
Notifications
You must be signed in to change notification settings - Fork 209
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
dynamic attributes #246
Comments
|
I tried.. But my real scenario will be like this
I have to use ternary operator .. can you please help in this |
the only thing that comes in my mind is to have an helper function, e.g:
|
Yes.. The solution is got worked. thank you for your quick reply... {this.props.children} The children can be another React component which is trying to access the "item.firstName"... We are getting an error like item is not defined. How we can pass the item to children so that i can use item in child components tooo. Thanks in advance. Regards, |
You should look into React's Context as way of passing data to children. Keep also in mind that |
Thank you .. for your suggestion... i agree children is array of childs
To access the "Item" in the childs you want me put this data in React context.. so that children is able to use that data and the below code snipet works
Please correct me if my understanding is not correct |
Can you please provide an simple Example how these React Teamplates works with React Context .. That will be an very good help for me. Regards, |
hi Team,
Need suggestion/help
I have scenario where i need to add attributes dynamically based on another attribute presence.
Ex:
Have a hyperlnik component which take several attributes as props from developer.
to this component i want to add attributes based on a prop like
if a prop called "dataTarget" is present then i need to add 2 more attributes called "data-toggle and
aria-expanded".. How i can do this react templates.
please provide any comments/direction
Regards,
Sridhar.V
The text was updated successfully, but these errors were encountered: