-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
duplicateThis issue or pull request already exists.This issue or pull request already exists.
Description
Hi guys first of all thanks for making this wonderful library. I am new to React and has started my projects using this framework.
While using i had a small problem related to CardMedia, when ever i am trying to change the image or src property using document.getElementById() or something related to this, it's not changing anything. Here is code if i am doing it wrong.
<CardMedia id="testImage"
className={classes.media}
image="/static/images/cards/contemplative-reptile.jpg"
title="Contemplative Reptile"
/>
//javascript code for manipulating image source
const testUrl = "https://www.fatbit.com/fab/wp-content/uploads/2015/12/material-design-3.jpg";
document.getElementById("testImage").src = testUrl;
console.log(document.getElementById("testImage"));
//here is console output
<div class="MuiCardMedia-root-7129 SimpleMediaCard-media-7100" id="testImage" title="Contemplative Reptile" style="background-image: url("/static/images/cards/contemplative-reptile.jpg");"></div>
My Environment
| Tech | Version |
|---|---|
| Material-UI | v1.2.0 |
| React | 16.4.0 |
| browser | chrome 66 |
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already exists.This issue or pull request already exists.