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.

New Dynamic Component

See original GitHub issue

Hi, this is not so much an issue as it is more an idea.

There’s currently no “BackgroundImage” component, which is not the end of the world, but it would be nice to have.

I think it would be possible to create such a component by cloning the “Image” component and storing the URL in a CSS Custom Property. Here’s an example:

const Wrapper = wrapper;

return (
    <Wrapper {...attributes} ref={this.attachRef} style={{ "--url": url }}>
        {children}
    </Wrapper>
 );
...
Dynamic.defaultProps = {
    wrapper: 'div',
};

Is that something viable?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
patrick-tolosacommented, Jan 17, 2021

Hey @fcisio, this feature is unlikely to be developed in the current SDK, however we are working on a new version of the SDK,

You can see more here: https://github.com/cloudinary/cloudinary-js-base

and specifically, a simple example of how to create a URL here https://github.com/cloudinary/cloudinary-js-base/blob/master/__DOC_EXAMPLES__/annotatedExamples/resize.md

We’ve broken down the SDK into two parts, a URL builder and a Framework component (React, Angular Vue etc.) You’ll be able to create custom components using the URL builder, such as the component shown in this thread.

This is not officially released yet, but it’s coming soon!

1reaction
idobarnoamcommented, Feb 11, 2020

Hi, @fcisio Thanks for the suggestion!

We’ve opened a request with our dev team to review this as it doe make sense.

We’ll update with any updates about this feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic component loader - Angular
An application might need to load new components at runtime. This cookbook shows you how to add components dynamically. See the live example...
Read more >
Loading Components Dynamically in an Angular App
Run the following command to create an Angular v13 app. npx @angular/cli@13 new dynamic-components --routing --style=scss --inline ...
Read more >
How To Create Dynamic Components In Angular Application
In this article, you will learn how to create dynamic components in angular ... Open a new terminal and run the following below...
Read more >
Angular Dynamic Components: Building a Dialog System
In this tutorial, you will learn what dynamic components are and how they work in angular. You will do so by creating ......
Read more >
Dynamically Creating Components with Angular - Netanel Basal
In this article, we will learn how to create components in Angular dynamically. First, we need a component. For the simplicity, we are...
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