Questions tagged [components]

0

votes
0

answer
5

Views

Jetpack's Architecture Components keeps recreating my fragments

I am using Jetpack's Architecture Components so that i can navigate between my fragments using a BottomNavigationView. The issue i'm having is that one of my fragments is Google Maps fragment, so when im on that fragment and move the map around, switch fragments, and come back, the map fragment relo...
Barcode
0

votes
0

answer
5

Views

Implementation problem with an Angular2 component with DynamicDialogRef and without DynamicDialogRef

I'm trying to implement a component with dynamic dialog and there is a need to use a direct usage. With the DynamicDialog example, there is a constructor of the car demo list component. constructor(private carService: CarService, public ref: DynamicDialogRef, public config: DynamicDialogConfig) { }...
Mumin Ka
1

votes
0

answer
9

Views

Debugging styled components with Create React App

I've installed Styled Components into my Create React App, and everything works fine, but by default, it looks as though the class name it appends to the element isn't based off of the styled component name (ie. MyButton should create an element with the class MyButton-134as23f). In the Styled Compo...
WonkasWilly
1

votes
1

answer
314

Views

Why my HTC files are not loading in IE quirks mode

I have a large legacy web app that uses HTC behavior in CSS. For example, .tabButtons { BEHAVIOR: url(/Echo/common/behaviors/tabPanel.htc); } This will work in IE 11, but I must go to Compatibility View Settings and add the domain. It is possible to use CSS behavior another way? I tried to put at th...
John Henckel
1

votes
1

answer
631

Views

How to install a project from github based on yii

I'm a newbie studying how it works YII. I found this project interesting. Yii2-simple-classified with app-advanced https://github.com/deviardn/diadoo I read the documentation but I do not know exactly what I should do to be able to test it on localhost. I already have YII2 installed with composer. w...
Faiberts
1

votes
3

answer
2.3k

Views

Get Height of document in React

How do you find the height of the entire document on page load in React? So in jQuery it would look something like: $(document).height(); Thanks for your help!
Ian Springer
1

votes
1

answer
237

Views

React HOC callback not working with default props

I made a simple HOC with recompose but for some reason its not working with default props. if I provide the props from outside its working properly, but not with the default props (I get 'onCallback' is not a function, so basically an undefined error) My HOC: import React from 'react' import { withS...
Istvan Orban
1

votes
1

answer
1.3k

Views

React global component

I am coming from a vue.js background and I have just recently started looking into react. I have a component: PageContent.jsx and I wish to use it without constantly having to import it to be able to use it inside the render function (JSX). In vue it is possible to globalise a component using: Vue.c...
Stan Hurks
1

votes
3

answer
982

Views

How do I call a method from another class component in React.js

So I have to class components: Class1: has a clickbutton Class2: has a method calling my api Basically, what I want is to call a method that sets and edits states inside one class from another class. But I keep failing. Example: Class1.js export class Class1 extends Component { render() { return ( )...
Cédric Bloem
0

votes
0

answer
6

Views

Upgraded to styled-components 3.4.10 and getting TypeError: (0 , n(…).createGlobalStyle) is not a function

Upgraded to styled-components 3.4.10 and getting TypeError: (0 , n(...).createGlobalStyle) is not a function error in chrome console. I thought createGlobalStyle was added in v4, so why would I see this error?
JoeTidee
0

votes
0

answer
7

Views

Angular 7.2.0 auto change detection is not triggering on button click

I have a component lets call it component A, in one module but using this component in the app root component template. This component A displays a button element using another component - let's call this component B. In component A's template sits Component B and another Component - let's call thi...
Chief
1

votes
1

answer
3.3k

Views

React - Display all properties of an object [duplicate]

This question already has an answer here: React 'cannot read property of undefined' when using map 2 answers I'm sure, this is a simple question, but actually I cannot find where my mistake is. I have a component where an object has not a fixed number of properties. Actually I'm having trouble to...
dns_nx
1

votes
1

answer
558

Views

Unknown “google is not defined” Google Maps integration in Angular 6

Here's the context of the problem I am trying to solve: I am trying to program a google map integration with a heat map overlay. It currently should be a visible map centered in San Francisco (later I will add a button to overlay the heat map and toggle the heat map). Yet, I keep getting this error...
Enesxg
1

votes
1

answer
158

Views

apply bootstrap theme globally using react styled-components

I've tried to search for examples showing how to import and use the bootstrap theme globally using styled-components but could only find samples showing styling of components (e.g. https://github.com/aichbauer/styled-bootstrap-components) or recreating the css in injectGlobal (e.g. https://medium.co...
80chew
1

votes
1

answer
52

Views

How to Make Square Icon Buttons with Rectangular SVG Icons Inside Them

I am attempting to make my own icon button using React, styled-components, and SVG. My icons are generally rectangular, however I want the buttons to be squares and to have the icons centered inside of them. This is where I am getting stuck. I tried tweaking the viewBox dimensions on the SVGs but...
Daniel Bank
3

votes
2

answer
22

Views

How to pass a prop with an event handler function in React?

I'm trying to run a simple app that renders different nicknames I've been given throughout my life in an array. I have two total components, the pushMe component as the child button and the nameFinder as the parent. I'm trying to pass my display() method into my pushMe button component as an onClic...
eye4eneye
1

votes
0

answer
4

Views

Composer: Including a custom js script via composer (then load via require.js)?

I've been tackling this for hours... When it comes to components, composer creates require.js and require.css files. I want to include my own script, so it can be loaded via the same require.js. Right now, even though it detects core.js and puts it in /core/libs folder: libs\WootWoot\core\js\core.j...
Dainius Vaičiulis
1

votes
0

answer
18

Views

Author a react + styled-components based UI framework

Author theme app use npx create-react-app theme to create a theme app Create a styled-component under components after installing styled-components. Use the above theme app as a library in the newly created project/app use npx create-react-app theme-test to create theme-test app import Button from...
Robin
0

votes
0

answer
6

Views

How to create a reusable Twig component

I work on a Symfony 3 app which uses Twig for rendering. To make the code more readable and reusable, I need to split a screen in small parts, parts which could be used in other screens (for example a clock widget). At first it seems easy, I could use the include Twig method to include that part of...
RadicalDingos
2

votes
0

answer
18

Views

Replacement of circular spots by respective colors

My objective here is to replace the spot in mask_image by a color corresponding to the spot in original_image. What I did here is to find connected components and labeling them, but I can't figure out how to find the corresponding labeled spot and replace it. Any help would be appreciated. Or how ca...
Chinmay Athavale
1

votes
0

answer
10

Views

Neutrinojs react component unexpected token with <></>

I'm creating an internal custom React component using Neutrinojs React component preset. So far I've managed to setup and build it. But somewhere in my component code I'm using this: Hello Custom Component and when I try to start the development mode, it won't run because of that syntax. If I manua...
Duc Hong
5

votes
3

answer
136

Views

AngularJS migration to using imports/exports

Our project is currently still running on AngularJS (v1.6) + TypeScript, but we want to start making the app ready to upgrade to the latest Angular, by implementing components, similar to how they are written in Angular. Currently we are not using imports or exports, but want to introduce this gradu...
Richard
1

votes
1

answer
224

Views

C# objectlistview undefined offset in cell editor

I use TreeListView component from ObjectListView library. I make cell values editable and when i double click on them TextBox will appear with odd offset. I want to remove this offset, but how? before start editing after start editing As you can see first row, second column ("My new device"), TextBo...
gek0n
1

votes
2

answer
677

Views

Vue.js - Open/close a dynamic Sidebar thought diferrent components (Navbar to Sidebar) using vuex

I'm trying to make a dynamic Sidebar on my website, but the menu button is in another component (Navbar). How can I get them to communicate with each other through vuex? Look, I know how to do it in the same component, but I'm struggling here to pass this boolean state from Navbar to Sidebar.
Tarcísio Melo
1

votes
1

answer
1.2k

Views

Room; Store integer array to a separate table?

Using Room ORM, I have declared an entity EQPreset using @Entity annotation. The entity contains an array int[]. It gives following error: error: Cannot figure out how to save this field (int[] arr) into database. You can consider adding a type converter for it. Normally saving EQPreset instance to...
Shoaib Anwar
1

votes
1

answer
289

Views

How do I build my own material-components-web.min.css?

I've been using material-components-web.min.css to style a Flask app in an MDC web manner. I could go through and edit the colors that I want by hand, but is there a simple method and framework that would allow me to define my own color palette, and then build a material-components-web.min.css with...
Keir Finlow-Bates
1

votes
2

answer
1.5k

Views

Repository to return LiveData when Room doesn't have it and instead fetches from REST API

I am looking for recommendation in handling below use case w.r.t. LiveData handling: ViewModel invokes Repository for LiveData (e.g. products catalog). Repository checks from LocalDataSource(Room) first but if data not available, invokes RemoteDataSource(REST API). Questions: 1) As per below commen...
birender
1

votes
1

answer
867

Views

React HOC DOM properties are triggering 'Unknown event handler property'

I just made a HOC with recompose but for some reason all the props passed down are triggering a React Warning. Warning: Unknown event handler property `onSaveChanges`. It will be ignored. And all my property which has the same syntax (starting with lower case, and then an upper case: lowerUpper). Of...
Istvan Orban
1

votes
2

answer
241

Views

Can we make android.app.Service as lifecycle aware compenent

all I get from the new Android Architecture Components is, if we make the component lifecycle aware then depending on the activity lifecycle the LifecycleObserver will react to the events. That reduces a lot of boilerplate code that we write in onCreate,onStop or onStart etc. activity or fragment li...
bash
1

votes
2

answer
225

Views

Should I add class attributes to Angular component selector tags

I'd like to add class directly to selector in Angular 5. Something like this: I've been searching for a while now, and I found some solutions like using host of @Component. But I can't find a definitive answer on the concrete question. Is it safe and is it considered a bad practice?
dzenesiz
1

votes
2

answer
202

Views

Method must be called from main thread,currenty inferred thread is worker

I am trying to change the wallpaper of Android every 15 minutes or something like this. A user can choose the time and I am running a periodic work using Workmanager. PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(SomeWorker.class, 15, TimeUnit.MINUTES).build(); WorkManag...
This Guy Codes
1

votes
2

answer
198

Views

Navigation Arch Component: Passing placeholder param for deeplink

I am trying to implement a deeplink functionality using the new Navigation Component API v1.0.0-alpha05 but running into an issue. Using Android Studio 3.3 Canary 7 Portion of my navigation_graph.xml AndroidManifest.xml contains: I am testing my deeplink with adb shell am start -a android.intent.act...
liminal
1

votes
3

answer
175

Views

custom component not a known element

I have an easy component in ionic, app it is just a test, I created the component with the ionic cli this is my app.module.ts: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { RouterModule, RouteReuseStrategy, Routes } from '@angular/rout...
arpho
1

votes
5

answer
150

Views

Customizing new Android MaterialButton for Google SignIn

Before migrating to AndroidX / MaterialComponents, I had customized the Buttons to look like this. Custom Google SignIn button: < Button android: id = "@+id/customGoogleSignInBtn" style = "@style/SocialLoginBtnStyle" android: background = "@color/googleColor" android: drawableStart = "@drawable/log...
Nishanth Sreedhara
1

votes
2

answer
25

Views

how can I dynamically attach sidebar components to multiple instances of sidebar?

I'm new to React and building out a design a ran into a problem. I have a component called SideBar. I am using this component two times, one on each side of the page. The problem is that I would like to add different components to each instance of the SideBar component. These would be lists of vari...
JSum
1

votes
2

answer
39

Views

Angular app 6 in ASP.NET Core: More than one module matches

Angular v6.1.10 | ASP.NET Core v2.2.102 I am building an Angular app from an ASP.NET Core template. I want to create a component (fish-form). In ASP.NET Core 2.0, a simple ng g component fish-form --module=app.module.shared.ts Would solve the problem, but with this architecture, as it doesn't have t...
Goncalo Peres
1

votes
1

answer
25

Views

Add additonal class names to custom React component

I'm wondering how to add additional class name to a custom React component, like a Button. So far I've tried with a traditional way of using class1 ${class2} and even classnames but it's not successful. Here's my sample to my attempt: https://codesandbox.io/s/1zp7m2yv3 import React from "react"; im...
Duc Hong
0

votes
0

answer
4

Views

Android Navigation Component Architecture w/Firebase Authentication

Does anybody have any experience using the Android Navigation Components with Firebase Authentication? I'm in the process of rebuilding my app with it and am now having issues with the current user being null. I think the NavHost is starting the first fragment before the auth comes back. Pretty...
JohnnyJacker
0

votes
1

answer
16

Views

styled-component import results in undefined

I'm just getting into styled-components and am having a little bit of an issue. I'm trying to extend a button through different files and for some reason it imports as undefined This error initially appeared with a NavLink component which led to believe it might be a react issue but it also happens...
dariuscosden
1

votes
1

answer
2.2k

Views

CakePHP 2.3.0 component $controller is not accessible

I am using Cakephp 2.3.0, loading following component. class BreadCrumbsComponent extends Component { public $components = array(); public $controller = null; public function initialize($controller) { } public function startup($controller) { $this->controller = $controller; } public function beforeR...

View additional questions