Posts by veroneseComS • 2,752 points
368 posts
-
3
votes1
answer27
viewsQ: Add extra spacing between dots with text-Decoration-style: dotted;
Is there any way to add extra space between the dotted inserted with text-decoration-style: dotted? I own this anchor: .anchor { text-decoration: underline; text-decoration-style: dotted;…
-
2
votes1
answer36
viewsQ: Is React able to automatically remove eventListeners from Refs when the component is destroyed?
I have an input from a web components that to receive the value inputado, I must create a Ref for that input and add a eventListener, respectively: const nameInputRef = useRef(null) const [userName,…
-
-1
votes1
answer25
viewsQ: How to define the component to be rendered in the React-Router-Dom Link?
According to the documentation, it is possible to render a custom element in the React-Router-Dom Link: If you would like use your Own navigation Component, you can Imply do so by Passing it through…
-
1
votes1
answer54
viewsQ: Why isn’t my web site being created/rendered?
I’m trying to create a button following the documentation Webcomponents however mine button is not being rendered on the page. I created a simple button extending the resources of a…
-
4
votes1
answer39
viewsQ: Should reducing functions be created outside or inside my React component?
Looking at the documentation of hook useReducer, I checked that the reducing function is created out of of the component: const initialState = {count: 0}; function reducer(state, action) { switch…
-
1
votes0
answers35
viewsQ: How to position Ivs of different heights one below the other?
I have four divs, the first three divs I need you to take the first line, and the fourth div just where the first div, however, when do I use display: flex to keep the first three divs on the same…
-
0
votes0
answers17
viewsQ: How do I access the mat-date-range-Picker’s isComplete() method in the template?
I’m trying to access the method isComplete() of mat-date-range-Picker in my template: You should select the range date But I’m getting this mistake: error TS2339: Property 'isComplete' does not…
-
1
votes0
answers17
viewsQ: Pre-trial e2e tests successfully run on site but shows Azure pipeline error
On my spot, when I turn the remote npm run e2e it runs the normal test and successfully runs the script: "e2e": "concurrently \"webdriver-manager start --standalone\" \"ng e2e\"" However, in the…
-
-1
votes2
answers78
viewsQ: Why is the input type number reset when I have a value starting with "-"?
I have a input in which I am trying to prevent the user from typing two minor symbols in a row, example: --155,5 My goal is to clear or remove one of the minor signs and remain the inputado value…
-
3
votes0
answers42
viewsQ: How to listen to coordinate changes on a canvas via a mobile device?
I created this component in Angular that has a canvas and when the user clicks and drags on that frame, the canvas is filled with coordinates positions. I tried to reproduce this same behavior in a…
-
3
votes1
answer28
viewsA: Enumerate API information in Angular
You can use your own content *ngFor to add the numbering: <div *ngFor="let carros of carro ; let iCarro = index" class="margin-bottom-20 width-100-l" > <div class="historico-titulo">…
-
0
votes1
answer85
viewsQ: Should we use Pipes instead of ternary condition in the template to render something in Angular?
I’m evaluating the best approach to rendering something in my template from a condition, so it avoids rendering and calling unnecessary functions to improve application performance. I realized that…
angularasked veroneseComS 2,752 -
0
votes1
answer62
viewsQ: How to avoid that when enrolling in an observable it receives the last amount issued?
I have a behaviorSubject that emits values and an Observable I use to receive the values issued: observableSource = new BehaviorSubject(null); observable$: Observable<string> =…
-
1
votes1
answer571
viewsA: Mat Form Field Angular: How to maintain the original font size when the form-field is focused?
For those who need it, I got an outline solution. My goal Maintain the font-size: 14px of label whether or not with Focus. The problem The component Material Form Field follows the specification of…
-
2
votes1
answer571
viewsQ: Mat Form Field Angular: How to maintain the original font size when the form-field is focused?
I’m using Angular Material form field with input. When I click on my form field, my label has the font-size decreased. How can I maintain my label’s original size when the form field has focus? I…
-
0
votes1
answer26
viewsA: Jasmine is not recognizing the getCurrentNavigation() function
If anyone goes through this problem, I resolved importing the module RouterTestingModule in the list of modules Imports of the test and removing the declaration of routerSpy that I created (The…
-
0
votes1
answer26
viewsQ: Jasmine is not recognizing the getCurrentNavigation() function
I’m trying to test a component that uses function getCurrentNavigation() of the Router to pick up data via navigation. My component is working normally with the expected purpose when I run with ng…
-
0
votes1
answer76
viewsQ: Java Spring: Post method does not insert relationship id
I’m learning the Spring framework, I tried to follow some 1-1 relationship tutorials where a library has an address. When uploading library data and address id in the body, a new record is inserted…
-
1
votes2
answers380
viewsA: The set function of the state of the React is not actually receiving and passing on the values
setPosts(response.data); is an asynchronous method, it means that the new state is not set instantly. When the method console.log(posts) is called, the value of its state has not yet been changed,…
-
1
votes0
answers72
viewsQ: How to clean a reactive Forms after a successful action in ngrx effects?
I own this Forms reactive: const createFormGroup = (dataItem?: Usuario) => { if (dataItem) { return new FormGroup({ id: new FormControl(dataItem.id), nome: new FormControl(dataItem.nome), cidade:…
-
1
votes1
answer80
viewsQ: Is it necessary to specify the MIME type in the src property when rendering an image in Base64?
I’m doing some image rendering tests on Base64 and I had some doubts. I realized that even passing the extension of the wrong image on mime type, it is still possible to render the image, in the…
-
-1
votes1
answer75
viewsQ: How to apply line break after an image?
I own a img and a Button, both are within one Grid library React-ui material. My goal is to center horizontal and vertical both the image and the button in the available space xs={4}, however, I…
-
0
votes1
answer34
viewsQ: Verticaltab Material React UI is being overlaid by tab content
I’m trying to use this component of vertical guides, but when I insert a large content it is superimposing my vertical-tab as you can see in this demonstration return ( <div…
-
3
votes1
answer283
viewsQ: What’s the difference between using a div and React.Fragment?
I am studying React more in depth and in one of the courses I am following is cited the use of <React.Fragment> to render multiple elements at once. Normally in my components I use a…
-
11
votes1
answer4239
viewsQ: What are the differences between Promise.all() and Promise.allSettled()?
I’m running some tests with Promises and I found that there are two ways to get the result of a set of protocols: using Promise.all(): async searchSegmentsInformations(segmentId) { try { const…
-
0
votes1
answer675
viewsA: How to capture Axios error Response data when user has no connection?
After researching for a while, I found this Issue on the Axios github where the same question was asked. As stated in the replies, it is impossible to detect network errors in the browser, so Axios…
-
2
votes1
answer675
viewsQ: How to capture Axios error Response data when user has no connection?
I am using the Third Party of axios to handle errors in requests. I am currently using this way: const api = axios.create({ baseURL: 'http://localhost:3333' }); api.interceptors.response.use(…
-
1
votes1
answer1670
viewsA: INSERT conflicted with FOREIGN KEY constraint
Your error occurs because you are trying to insert a record into the table ITEM_PEDIO with the COD_PEDIDO: 1048, 1044, 1045, 1046 and 1047, but they do not exist in the table REQUEST, making it…
-
1
votes1
answer727
viewsA: Background image using bootstrap
The bootstrap is nothing more than a library with multiple classes, so when you use bg-dark, bg-light or bg-danger your element has changed background. Your problem does not seem to be with the…
-
0
votes1
answer188
viewsQ: My component within my modal is rendering twice
I have a parent component that opens a modal based on the value of this variable: const [openFullScreenModal, setOpenFullScreenModal] = useState(false) I have a button in this component that arrow…
reactasked veroneseComS 2,752 -
1
votes1
answer223
viewsQ: Change states between parent and child components with modal
I have a component that I need to control when the modal will open/close, where the parent component is the component that will open the modal and the child component (which is the modal) will…
reactasked veroneseComS 2,752 -
0
votes1
answer251
viewsA: How to decrease Bar that displays the number of lines and Vscode Sidebar
The right bar you can open/remove as follows: Ctrl + Shift + P > Toggle Minimap > Enter The one on the left I don’t know if you have how, and I wouldn’t recommend removing it because knowing…
-
1
votes2
answers201
viewsQ: How to remove repeated elements from an object array by preserving the object that has a different id property than null
I need to remove the elements that have the same value in the property screen_id keeping whatever has the property id other than null. My sample object: let userPermissions = [ { id: 1, description:…
javascriptasked veroneseComS 2,752 -
4
votes2
answers686
viewsQ: How to join two object arrays by different keys?
I have two object arrays: let mergedScreensAllCompanies = [ { id: 1, description: Cadastro de usuários, }, { id: 2, description: Cadastro de filiais, } ] let userScreens = [ { id: 1, user_id: 1,…
-
1
votes1
answer241
viewsQ: Yup: How to make a conditional rule?
I’m trying to make a conditional rule with Yup, but following the steps of the documentation, I get this mistake: Typeerror: ref must be a string, got: true if (typeof key !== 'string') throw new…
-
0
votes1
answer125
viewsQ: How to remove blue border from React Material Modal?
I’m using that React Material Modal. In the examples, when opening the modal, it is wrapped in a blue border, there is some way to remove this effect? I saw on the Modal api that owns a property…
-
4
votes2
answers86
viewsQ: "Child already has a Parent, it must be Removed first" when sending new object to Reducer
I have a table where I want to sort your data. The table is copulated through the values of this useSelector() const users = useSelector(state => state.userStates.users) When the user clicks on…
-
0
votes1
answer64
viewsQ: How to apply a css class to a child element of a component with javascript?
I have a component called <PDFDownloadLink> I need to change the child <a> that he owns. With syntax css I would do something like: PDFDownloadLink a { } How could do the similar with…
-
1
votes1
answer32
viewsA: Table is not rendered again after a setState
My problem was because by changing the array order, React still fills that component has the same state, so it is not rendered again. It was necessary to create a copy of the object: const sortBy =…
-
1
votes1
answer32
viewsQ: Table is not rendered again after a setState
I have a table of Material React Ui and I’m trying to accomplish sort in the data. After the array is sorted, my table is not being rendered with the new positions set by sort. I already checked the…
-
0
votes1
answer37
viewsQ: Use useEffect every time my Location.pathname is changed
I have a variable called nameScreen that I need to change its value every time the location.path is changed (whenever there is a route change): <Typography variant="h6" noWrap> {nameScreen}…
-
1
votes1
answer1034
viewsQ: When using history.push() my component does not render, you need to re-load the page to render
I’m using React-router-dom to work with routes in an React application. I have a file called Approuter.js that has my routes: const AppRouter = props => { const loading = useSelector(state =>…
-
0
votes1
answer141
viewsQ: "Can’t perform a React state update on an unmounted Component" when I try to change the state in useEffect
I have a React UI Material Server and I need that when the component is mounted, check the localStorage and take the value of the logged in user to show in the template. This is my component: const…
-
2
votes1
answer2464
viewsQ: How to validate objects inside objects with Yup/formik?
I am using formik with Yup to handle my forms and need to validate two objects I have set in my initial formik values: initialValues: { company: { company_name: '', cnpj: '', fantasy_name: '',…
-
-1
votes1
answer172
viewsQ: My useSelector variable is printing Undefined even when Reducer has returned the value
I have this saga that performs an http request and performs a Dispatch on my Reducer: // worker Saga: will be fired on GET_FILIAIS_REQUEST actions function* fetchFiliais(action) { try { const data =…
-
0
votes1
answer288
viewsQ: When changing an option of my material select I get: Use the `defaultValue` or `value` props on <select> Instead of Setting `Selected` on <option>
I have the following material-ui-React select component: <FormControl fullWidth variant="outlined" className={classes.formControl}> <InputLabel ref={inputLabel}…
-
0
votes1
answer343
viewsQ: How to change the style of a component without creating another component with Styled Components
I have in the file Loginwrapper.js the import of a Grid material design: import Grid from '@material-ui/core/Grid'; I have in the Loginstyles.js file a css change for this component: import styled…
-
10
votes2
answers462
viewsA: How to recover an array saved on localStorage
You need to parse your string for JSON: pessoaAntiga = JSON.parse(window.localStorage.getItem('pessoa'))
-
7
votes2
answers421
viewsQ: How to apply conditions in this string template?
Currently I own this object: const messages = { required: field => `${field} é obrigatório e naõ foi preenchido!`, } That prints the following value: name é obrigatório e não foi preenchido! I…
-
0
votes1
answer106
viewsQ: Nginx: Angular pages not being loaded
I have a backend application Node.js (Adonis) and frontend (angular). I installed Nginx and set it up this way: #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log…
nginxasked veroneseComS 2,752