prop Questions

3

I am trying to pass a prop of type string to a functional component defined in the same file and it is throwing the error: TS2322: Type '{ text: string; }' is not assignable to type 'string'. I hav...
Vanwinkle asked 17/1, 2022 at 19:21

3

My question is this. I have two components. First component is an image cropper. Second component is the one that i should display the cropped image. The problem i'm facing is i can pass the crop...
Cladophyll asked 1/9, 2017 at 2:49

5

Solved

I've created a button with an attribute named 'loaded' and initial value of 'no'. Upon clicking the button I'm running some ajax and at the very end of it I'm trying to set the 'loaded' attribute t...
Membership asked 1/8, 2013 at 7:23

18

Solved

So jQuery 1.6 has the new function prop(). $(selector).click(function(){ //instead of: this.getAttribute('style'); //do i use: $(this).prop('style'); //or: $(this).attr('style'); }) or in ...
Checkers asked 3/5, 2011 at 19:33

3

Solved

Having the following method in my child component which updates state on prop changes which works fine componentWillReceiveProps(nextProps) { // update original states this.setState({ fields: ...
Joinder asked 29/3, 2020 at 19:3

2

Solved

If I'm passing (a reference to) an Object as a prop is it OK to mutate values in the prop? I'm developing a web app which will require a lot of values to be passed to a component, and I'm trying t...
Scherzo asked 17/9, 2019 at 21:1

1

Solved

Here's the basic idea... constructor(props) { super(props); this.state = { children: [{id:1},{id:2}], // HERE ARE THE TWO OBJECTS style: {top: 0} }; } Now let's say I update one of those tw...
Goldeye asked 29/6, 2017 at 10:19

1

Solved

I'm new to react and i was learning subclasses from one of Lynda examples. I'm creating a new subcomponent class called aptList and using this.props.eachItem.ownerName to iterate through each index...
Languid asked 27/6, 2017 at 7:43

1

Solved

I have two select fields in my form. The first one is single-select and the other is multiple-select. Now what I want to do is select options in the multiple-select with given data depending on the...
Sac asked 8/7, 2016 at 10:47

1

Solved

I am simply trying to get a couple of properties from two elements. Getting the property value from the input element works as expected. The problem is with getting the property data-detail propert...
State asked 16/4, 2016 at 11:41

7

Solved

HTML: <form class="form"> <input type="checkbox" id="box" /> Check Me! </form> JS: $(window).load(function() { var myFunc = function() { if($('#box').prop('checked', ...
Alejandrinaalejandro asked 27/6, 2014 at 4:38

5

Solved

having problems with .prop("disabled", false) it's works fine in opera and firefox but IE and chrome i can't get it to work.. Actualy it's a invination form and im make send button like this <...
Larrylars asked 11/2, 2012 at 13:5

4

Solved

Now this isn't just another What's the difference question, I have done some tests(http://jsfiddle.net/ZC3Lf/) modifying the prop and attr of <form action="/test/"></form>​ with the out...
Vestal asked 6/11, 2012 at 8:22

2

Solved

I'd like to get a script that can grab the user's user agent and prop it to an attribute. I'm making a website problems contact form and I usually need to know what browser the user is using. How ...
Allgood asked 26/2, 2012 at 2:42

1

Solved

If I want to change the href of a link dynamically, should I do so using prop() or attr()?
Cupronickel asked 12/8, 2013 at 14:38

4

Solved

Can I, a jQuery1.9+ software developer, "deprecate" the use of the attr() method in my day-by-day work? As showed in many questions, .prop() vs .attr() (main) jQuery attr vs. prop, there are a...
Emulsoid asked 25/2, 2013 at 15:20

3

Solved

I saw in some places .attr() is used in jQuery.In some places .prop() is used.But i searched in SO and google i am very confused .Please tell me the exact difference between these two and whe...
Lampyrid asked 17/4, 2013 at 4:27

2

This is not a duplicate question, I need only to decide if the better/fast/correct is to use attr or to use prop. The simplest and reliable way is checking into a list. A "list of element-nam...
Constructive asked 24/2, 2013 at 22:13

7

Solved

The html structure I have is something like: <ul id="something"> <li> <a href=""> <img src="http://domain.com/directory/file1-128x79.jpg"> </a> </li> <...
Stimulate asked 4/7, 2011 at 7:18
1

© 2022 - 2024 — McMap. All rights reserved.