반응형

 

my browser randomly changed its search engine to secure search, should I be concerned?

update:(problem has been solved. McAfee was the cause, so I removed it from my computer)

출처: https://www.reddit.com/r/chrome/comments/11norde/my_browser_randomly_changed_its_search_engine_to/?rdt=61227

반응형
반응형

엄마폰에서 크롬으로 티스토리 로그인해서 내 블로그글을 수정하려 했으나 글 삭제만 가능하고 수정 및 새글쓰기가 안되는 현상발행

내폰에서 설치한 티스토리 앱에서는 동일한 형식의 스킨이 나오지만 수정이 가능함 - 즉 수정하려면 티스토리 앱을 깔아야 한다는 것?

앱안깔고도 수정가능한 방법 찾아보니 설정>모바일>모바일웹 자동연결 사용안함으로 설정해야 한다고 함

...그래도 안되는것 같았는데 좀있다 다시하니 모바일 자체스킨이 아닌 내가 설정한 스킨으로 나오고 수정도 가능(근데 수정화면이 모바일용이 아니라 너무 작긴했으나 작동은 함)

근데 노트북에서 symn.tistory.com/m 들어가니 모바일 자체 스킨이 나옴,,, 결국 뭘해도 symn.tistory.com/m은 자체 스킨으로만 나오고 자체 스킨 아닌 내가 설정한 스킨 나오게 하려면 symn.tistory.com로 들어가야함

반응형
반응형
반응형
반응형
반응형
반응형

s20fe는 초기화 메뉴 위치도 일반이 아닌 계정및 동기화에 있고 네트워크 설정 초기화라고 해서 wifi/mobile/bluetooth한꺼번에만 초기화 가능 - 불편함

반응형
반응형

반응형
반응형

eiSettings

import { useForm } from "react-hook-form";
  const { setValue, handleSubmit, control } = useForm({ mode: "all", reValidateMode: "onChange", defaultValues: { groups: [] } });
 setValue("groups", []);
        const date = searchDate === "undefined" ? "" : searchDate;
        setIsLoading(true);
        const origin = await request({ ...getEiSet, body: { corporationCode: userStore.user?.corporationCode, searchDate: date, centerType, evType: codes[centerType][evType] } });
        const data = origin?.settings?.length ? origin.settings.map((item) => (item.divisions ? item : { ...item, divisions: getDefaultValue(centerType, evType).divisions })) : [getDefaultValue(centerType, evType)];
        setApplyDate({ month: origin?.baseMonth ? moment(origin.baseMonth).format("YYYY.MM") : "undefined", start: origin?.startDay ? moment(origin.startDay).format("YYYY.MM.DD") : "", end: origin?.endDay ? moment(origin.endDay).format("YYYY.MM.DD") : "" });
        if (origin?.baseMonth) setSearchDate(moment(origin.baseMonth).format("YYYY-MM"));
        setOverIncentiveVolume(origin?.overIncentiveVolume);
        setOverIncentiveVal(origin?.overIncentiveVal);
        let levelObj = {};
        origin?.levelSetting?.forEach((n) => (levelObj[n.levelCode] = n.levelIncentiveVal));
        setLevels(levelObj);
        setValue("groups", data);
반응형
반응형
반응형
반응형

var(--LG-Red)

src/scss/mobilecommon.scss

 

https://www.w3schools.com/css/css3_variables.asp

 

 

variables.scss, $변수를 사용할 수도 있음

$primary-color-red: #bb0841;
$primary-color-red-hover: #82072e;
$primary-color-grey: #323232;

$secondary-color-gery: #fbfbfb;
$border-color-gery: #d5d5d5;
$border-color-deep: #cccccc;
$hover-color-pink: #faf1f4;
$board-color-grey: #f6f6f6;
$board-color-txt: #5f5f5f;
$backgorund-color-grey: #888888;
$line-color-grey: #d8d8d8;
$btn-color-pink: #ed5c7d;
$btn-color-grey: #828282;

$txt-color-edit: #2468c4;
$txt-color-content: #666666;

$chart-color-pink: #faf1f4;
$chart-color-grey: #d7d7d7;
 
$primary-color-grey: #f4f4f4;
$primary-color-black: #262626;
$primary-color-red: #a50034;
$primary-color-pink: #fff8fb;

$LG-Red: #a50034;
$Mid1-Red: #c5597b;
$Mid2-Red: #d2809a;
$Light1-Red: #ffedf3;
$Dark-Mid2-Red: #7c0328;
$White: #ffffff;
$Dark-Gray1: #333333;
$Dark-Gray2: #262626;
$Dark-Gray3: #1a1a1a;
$Mid-Gray1: #cbc8c2;
$Mid-Gray2: #7e7c77;
$Mid-Gray3: #4a4946;
$Light-Gray1: #f6f3eb;
$Light-Gray2: #f0ece4;
$Light-Gray3: #e6e1d6;
$Light-Gray-BG: #f4f4f4;
$Light-Pink-BG: #fff8fb;
$Light-Linen-BG: #ffece2;
$Light-Red-BG: #fde8e8;
$Light-Yellow-BG: #fff4d6;
$Light-Green-BG: #e9f2e5;
$Orange-Point: #ce3c0b;
$Brown-Point: #9c6800;
$Active-Red: #ea1917;
$Green: #287d00;

common.scss

:root {
  --primary-color-red: #{$primary-color-red};
  --primary-color-red-hover: #{$primary-color-red-hover};
  --primary-color-grey: #{$primary-color-grey};

  --secondary-color-gery: #{$secondary-color-gery};
  --border-color-gery: #{$border-color-gery};
  --border-color-deep: #{$border-color-deep};
  --hover-color-pink: #{$hover-color-pink};
  --board-color-grey: #{$board-color-grey};
  --backgorund-color-grey: #{$backgorund-color-grey};
  --line-color-grey: #{$line-color-grey};

  --txt-color-edit: #{$txt-color-edit};
  --txt-color-content: #{$txt-color-content};

  --chart-color-pink: #{$chart-color-pink};
  --chart-color-grey: #{$chart-color-grey};

  --LG-Red: #{$LG-Red};
  --Mid1-Red: #{$Mid1-Red};
  --Mid2-Red: #{$Mid2-Red};
  --Light1-Red: #{$Light1-Red};
  --Dark-Mid2-Red: #{$Dark-Mid2-Red};
  --White: #{$White};
  --Dark-Gray1: #{$Dark-Gray1};
  --Dark-Gray2: #{$Dark-Gray2};
  --Dark-Gray3: #{$Dark-Gray3};
  --Mid-Gray1: #{$Mid-Gray1};
  --Mid-Gray2: #{$Mid-Gray2};
  --Mid-Gray3: #{$Mid-Gray3};
  --Light-Gray1: #{$Light-Gray1};
  --Light-Gray2: #{$Light-Gray2};
  --Light-Gray3: #{$Light-Gray3};
  --Light-Gray-BG: #{$Light-Gray-BG};
  --Light-Pink-BG: #{$Light-Pink-BG};
  --Light-Linen-BG: #{$Light-Linen-BG};
  --Light-Red-BG: #{$Light-Red-BG};
  --Light-Yellow-BG: #{$Light-Yellow-BG};
  --Light-Green-BG: #{$Light-Green-BG};
  --Orange-Point: #{$Orange-Point};
  --Brown-Point: #{$Brown-Point};
  --Active-Red: #{$Active-Red};
  --Green: #{$Green};
}
반응형
반응형

반응형
반응형

    input + input {
      margin-top: 10px;
    }

반응형
반응형

input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`

반응형
반응형

https://codesandbox.io/s/explorer-l44v98?file=/index.js

 

Explorer - CodeSandbox

Explorer by fir0j using antd, react, react-dom, react-icons, react-scripts, styled-components

codesandbox.io

 

위 소스는 자식이 2개 이상 있으면 2개가 한꺼번에 오픈되는 에러 있음, 아래는 에러 수정한 버젼

import React, { Fragment, useEffect, useState } from "react";
import { IoMdArrowDropright } from "react-icons/io";
import { MdArrowDropDown } from "react-icons/md";
import styled from "styled-components";

const SelectParent = styled.div`
  padding: 7px 7px;
  background-color: darkblue;
  width: max-content;
  border-radius: 4px;
  margin-top: 4px;
  font-weight: bolder;
  color: white;
  cursor: pointer;
`;

const Selectname = styled.div`
  margin-top: 5px;
  padding: 7px 7px;
  width: fit-content;
  border-radius: 4px;
  cursor: default;
  color: darkblue;
  :hover {
    background-color: #bdbaba3c;
  }
`;

const Explorer = ({ parent = [], onParentClick, onNameClick /*expandOnHover = false*/ }) => {
  const [newData, setNewData] = useState([]);

  useEffect(() => {
    setNewData(parent.map((n) => ({ ...n, expand: false })));
  }, [parent]);

  const handleClickOnParent = (e, data) => {
    e.stopPropagation();
    if (onParentClick && onParentClick instanceof Function) onParentClick(data);

    const clickIdx = newData.findIndex((n) => data.name === n.name);
    const clickItem = newData.find((n) => data.name === n.name);

    setNewData([...newData.slice(0, clickIdx), { ...clickItem, expand: !clickItem.expand }, ...newData.slice(clickIdx + 1, newData.length)]);
  };

  const handleClickOnName = (e, data) => {
    e.stopPropagation();

    if (onNameClick && onNameClick instanceof Function) onNameClick(data);
  };

  return (
    <>
      {newData.map((item) => (
        <Fragment key={item.name}>
          {item.children && item.children.length ? (
            <Fragment /*key={index}*/>
              <SelectParent /*onMouseOver={() => (expandOnHover ? setExpand(true) : {})}*/ onClick={(e) => handleClickOnParent(e, item)}>
                {item.name} <span>{!item.expand ? <IoMdArrowDropright /> : <MdArrowDropDown />} </span>
              </SelectParent>

              {item.expand ? (
                <div style={{ paddingLeft: "1.5rem" }}>
                  <Explorer parent={item.children} onParentClick={onParentClick} onNameClick={onNameClick} /*expandOnHover={expandOnHover}*/ />
                </div>
              ) : null}
            </Fragment>
          ) : (
            <Selectname onClick={(e) => handleClickOnName(e, item)}>{item.name}</Selectname>
          )}
        </Fragment>
      ))}
    </>
  );
};

export default Explorer;
반응형
반응형

rowspan 사용예제

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td rowspan="2">January</td>
    <td>1</td>
    <td>2</td>
  </tr>
  <tr>
    <td>3</td>
    <td>4</td>
  </tr>
  <tr>
    <td rowspan="2">February</td>
    <td>11</td>
    <td>22</td>
  </tr>
  <tr>
    <td>33</td>
    <td>44</td>
  </tr>
</table>

 

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td_rowspan

 

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td_colspan

반응형
반응형
.popupModal [class="image"] {
    text-align: center;
  }
반응형
반응형
반응형
반응형

const a = arg||'default' 주로 이렇게 초기화용도로 쓰는데 0, ''도 정상값일 경우는 ??를 쓰면 됨

 

Nullish coalescing operator

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing

 

Logical or operator

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR

 

 

반응형
반응형

style={{width: n.position?.width||'100%'}} 로 구지 안해도 style={{width: n.position?.width}} 만 하면 됨, n.position이 null이면 n.position?.width는 undefined가 되므로

반응형
반응형

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at editorwatchdog.js:179:1
    at async u._initializeEditor (index.js:5:4518)
    at async u.componentDidMount (index.js:5:3736) {phase: 'initialization', willEditorRestart: false}phase: "initialization"willEditorRestart: false[[Prototype]]: Object
(anonymous) @ index.js:5
Promise.catch (async)
_initializeEditor @ index.js:5
await in _initializeEditor (async)
componentDidMount @ index.js:5
commitLayoutEffectOnFiber @ react-dohttp://m.development.js:23349
commitLayoutMountEffects_complete @ react-dohttp://m.development.js:24727
commitLayoutEffects_begin @ react-dohttp://m.development.js:24713
commitLayoutEffects_begin @ react-dohttp://m.development.js:24695
commitLayoutEffects @ react-dohttp://m.development.js:24651
commitRootImpl @ react-dohttp://m.development.js:26862
commitRoot @ react-dohttp://m.development.js:26721
performSyncWorkOnRoot @ react-dohttp://m.development.js:26156
flushSyncCallbacks @ react-dohttp://m.development.js:12042
(anonymous) @ react-dohttp://m.development.js:25690
Show 13 more frames
Show less

 

 

Cannot read properties of null (reading 'model') TypeError: Cannot read properties of null (reading 'model') at http://localhost:3000/app.2d361dd0ad882d7da2b1.min.js:289211:20

 

 

 

https://github.com/ckeditor/ckeditor5-react/issues/442

 

TypeError: Cannot read properties of null (reading 'model') · Issue #442 · ckeditor/ckeditor5-react

I'm trying to implement CKEditor 5 to my Nextjs project using this guide: https://ckeditor.com/docs/ckeditor5/latest/installation/integrations/next-js.html However when I try to run the webpage sho...

github.com

 

반응형
반응형

import { parse } from "node-html-parser";
dangerouslySetInnerHTML={{ __html: parse(n.content)?.toString() }} 원래 소스에는 parse를 적용했는데 안해도 나왔음

반응형
반응형

react-dom.development.js:86 Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components

 

 

react-dom.development.js:86 Warning: `value` prop on `input` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.

반응형
반응형

서버에 올리면 onLoad, onError event 둘다 안탈때가 있음 왜그런지는?

반응형
반응형

반응형
반응형

 

<label class="required">Name:</label>
<input type="text">

<style>
  .required:after {
    content:" *";
    color: red;
  }
</style>

https://stackoverflow.com/questions/11197671/use-css-to-automatically-add-required-field-asterisk-to-form-inputs

반응형
반응형

 

{route.path === "/board/viewimage" && (
              <>
                <meta name="viewport" content="initial-scale=1,width=device-width,user-scalable=1" />
              </>
            )}

반응형
반응형

반응형
반응형

 

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at editorwatchdog.js:179:1
    at async u._initializeEditor (index.js:5:4518)
    at async u.componentDidMount (index.js:5:3736) {phase: 'initialization', willEditorRestart: false}

 
TypeError: Cannot read properties of null (reading 'model') at editorwatchdog.js:228:1

 

반응형
반응형

context 생성: import { createContext } from "react"

import { createContext } from "react";

// 기본값으로는 null을 넣어준다.
export const ThemeContext = createContext(null);

context 연결 <ThemeContext.Provider value={{ isDark, setIsDark }}>

import { useState } from "react";
import "./App.css";
import Page from "./Compopnents/Page";
import { ThemeContext } from "./context/ThemeContext";

function App() {
  const [isDark, setIsDark] = useState(false);

  return (
    // 📌
    <ThemeContext.Provider value={{ isDark, setIsDark }}>
      <Page />
    </ThemeContext.Provider>
  );
}
export default App;

 

context 사용 & 변경

  • import { useContext } from "react"
  • const { isDark, setIsDark } = useContext(ThemeContext);이때 setIsDark 콜하면 전체화면 refresh됨
import { useContext } from "react";
 // 📌 
import { ThemeContext } from "../context/ThemeContext";

const Header = () => {
  // 📌 
  const { isDark, setIsDark } = useContext(ThemeContext);////////////////////////
  return (
    <header
      className="header"
      style={{
        backgroundColor: isDark ? "black" : "lightgray",
        color: isDark ? "white" : "black",
      }}
    >
      <h1>Welcome 홍길동!</h1>
    </header>
  );
};

export default Header;

 

context를 가장 상위에서 불러와서 쓰기 때문에 전체 화면 refresh되는 것인지?

context를 state전용, dispatch전용으로 나누어써야 불필요한 렌더링 막을수 있다고 하는 예제https://velog.io/@shin6403/React-ContextAPI-%EC%9D%B4%EB%A0%87%EA%B2%8C-%EC%8D%A8%EB%B3%B4%EC%9E%90

 

[React] ContextAPI 이렇게 써보자

어느날 구글링을 하다가 어떠한 글을 보았다.Context API는 왜 안쓰나요?ContextAPI를 쓰는 글쓴이에게 굉장히 관심이 가는 글이었고, 내용을 결론은 소규모 프로젝트에서는 ContextAPI가 좋지만 성능 때

velog.io

useReducer, useCallback, memo등을 같이 사용하고 있음

반응형
반응형

처음 적용하고 됐는데 새 컴퓨터에 설치하니 경로이동이 안되었음 - jsconfig.json 파일을 그냥 고치고나서 해보니 다시 됨

 

{
  "compilerOptions": {
    //"module": "commonjs",
    //"target": "es6",
    "baseUrl": ".",
    "paths": {
      //"@/*/*": ["./src/*"] //not working
      "@components/*": ["./src/components/*"],
      "@component/*": ["./src/component/*"],
      "@views/*": ["./src/views/*"],
      "@page/*": ["./src/page/*"],
      "@store/*": ["./src/store/*"],
      "@hooks/*": ["./src/hooks/*"],
      "@utils/*": ["./src/utils/*"],
      "@assets/*": ["./src/assets/*"],
      "@scss/*": ["./src/scss/*"]
    }
  },
  "exclude/*": ["node_modules"]
}

 

import { useAlert, useResponsive } from "@hooks";

이 경우는 @hooks/* 로 커버안됨,

"@hooks": ["./src/hooks"], 추가해줘야함
반응형
반응형

반응형

+ Recent posts