question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Newly created list elements do not appear

See original GitHub issue

Describe the bug

When mapping through list elements, and the list changes after the initial render, the list items are not rendered properly (especially when wrapped inside the Text component)

To reproduce

Go to the sandbox and paste following code:

const FONT_FAMILY_ROOT = '"Titillium Web", sans-serif';
const SOUND_TYPE_URL = '/assets/sounds/type.mp3';

const audioSettings = { common: { volume: 0.25 } };
const playersSettings = { type: { src: [SOUND_TYPE_URL], loop: true } };
const bleepsSettings = { type: { player: 'type' } };
const animatorGeneral = { duration: { enter: 150, exit: 150, stagger: 40 } };

const Sandbox = () => {
  const [activate, setActivate] = React.useState(true);

  
  const [texts, setTexts] = React.useState(["foo", "bar"]);
  React.useEffect(() => {
    const timeout = setTimeout(() => setTexts([...texts, "another Text"]), 1000);
    return () => clearTimeout(timeout);
  }, [texts]);

  return (
    <ArwesThemeProvider>
      <BleepsProvider
        audioSettings={audioSettings}
        playersSettings={playersSettings}
        bleepsSettings={bleepsSettings}
      >
        <StylesBaseline styles={{
          body: { fontFamily: FONT_FAMILY_ROOT }
        }} />
        <AnimatorGeneralProvider animator={animatorGeneral}>
          <Animator animator={{ activate }}>

            <List>
              <li><Text>Lorem ipsum lov sit amet.</Text></li>
              <li><Text>Lorem ipsum lov sit amet.</Text></li>
              { texts.map((text, index) => (
                <li
                  key={index}
                >
                   <Text>
                     {text}
                   </Text>
                </li>
                )) }
            </List>


          </Animator>
        </AnimatorGeneralProvider>
      </BleepsProvider>
    </ArwesThemeProvider>
  );
};

render(<Sandbox />);

Expected behavior

List items appear and are rendered correctly

Development environment

Sandbox ( v. 1.0.0-alpha.19 )

Additional Info

One can see that the icons are created (hovering over the not-rendered list elements yields a text-cursor) You can also see the elements with the browser development tools

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
InsOpDecommented, Jan 3, 2022

thanks, that worked!

1reaction
romelperezcommented, Aug 1, 2021

Hey @InsOpDe !

This bug was recently reported and fixed. It should work fine for the next release.

Thank you for your report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Why list is not shown on page - Stack Overflow
Your problem was textContent attribute, you need to set the innerText or innerHTML to that a element. Share. Share a ...
Read more >
Get started with Lists in Teams - Microsoft Support
On mobile devices, team members can view and edit lists, but not create or add them. ... Added lists appear as tabs along...
Read more >
.add() | jQuery API Documentation
Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of...
Read more >
Handling dynamically created HTML in JavaScript - Medium
This is possible as the JavaScript is executed immediately after the elements are declared in the DOM — the elements are guaranteed to...
Read more >
Document.createElement() - Web APIs | MDN
The nodeName of the created element is initialized with the value of ... Define the new element customElements.define("expanding-list", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found