• Anže Kovač
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am having trouble using lightning:container when i want to use my react application. I am using the the react-trivia app which is presented in the dreamforce session.

this is the error i am getting container.lightning.com’s server DNS address could not be found.


Thanks
Pramodh

After creation of components dynamically using $A.createComponent() and pushing it to the desired div, component.find("<aura:ID of component>").get("v.value"), where the component used is a 'lightining:input' and aura:ID has already been defined, is showing error message as 'cannot read property get of undefined'. PFB the code snippet:

 

$A.createComponents([
            ["lightning:input",
             {"aura:ID" : 'fName',
              "name" : 'fName',
              "label" : 'First Name'}],
            ["lightning:input",
             {"aura:ID" : "lName",
              "name" : 'lName',
              "label" : 'Last Name'}],
            ["lightning:input",
             {"aura:ID" : 'mAddress',
              "name" : 'mAddress',
              "label" : 'Mailing Address'}]
        ],function(newDynDiv, status, errorMessage){
            if (status === "SUCCESS"){
                var target = component.find("conForm");
                var body = target.get("v.body");
                body.push(newDynDiv[0], newDynDiv[1], newDynDiv[2]);
                
                target.set("v.body", body); // working fine till here and components are getting added to desired location.
                
                       

           var fVal = component.find("fName").get(v.value); // This shows the error 'cannot read property get of undefined'

            }
            else if (status === "INCOMPLETE") {
                
                alert("No response from server or client is offline.")
                
                // Show offline error
                
            }
            
                else if (status === "ERROR") {
                    
                    alert("Error: " + errorMessage);
                    
                    // Show error message
                    
                }
            
        });

I am having trouble using lightning:container when i want to use my react application. I am using the the react-trivia app which is presented in the dreamforce session.

this is the error i am getting container.lightning.com’s server DNS address could not be found.


Thanks
Pramodh